@galacean/engine-core 1.2.0-alpha.1 → 1.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +178 -194
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +178 -194
- package/dist/module.js +178 -194
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Camera.d.ts +11 -5
- package/types/Engine.d.ts +4 -2
- package/types/Utils.d.ts +6 -0
- package/types/asset/AssetType.d.ts +2 -0
- package/types/asset/ResourceManager.d.ts +2 -0
- package/types/input/InputManager.d.ts +0 -2
- package/types/input/interface/IInput.d.ts +0 -8
- package/types/shaderlib/ShaderFactory.d.ts +5 -1
package/dist/module.js
CHANGED
|
@@ -595,7 +595,14 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
595
595
|
* @param url - The url to be judged.
|
|
596
596
|
* @returns Whether the url is absolute url.
|
|
597
597
|
*/ Utils.isAbsoluteUrl = function isAbsoluteUrl(url) {
|
|
598
|
-
return /^(
|
|
598
|
+
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
599
|
+
};
|
|
600
|
+
/**
|
|
601
|
+
* Judge whether the url is base64 url.
|
|
602
|
+
* @param url - The url to be judged.
|
|
603
|
+
* @returns Whether the url is base64 url.
|
|
604
|
+
*/ Utils.isBase64Url = function isBase64Url(url) {
|
|
605
|
+
return /^data:.*,.*$/i.test(url);
|
|
599
606
|
};
|
|
600
607
|
/**
|
|
601
608
|
* Get the values of an object.
|
|
@@ -613,7 +620,10 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
613
620
|
if (Utils.isAbsoluteUrl(relativeUrl)) {
|
|
614
621
|
return relativeUrl;
|
|
615
622
|
}
|
|
616
|
-
|
|
623
|
+
if (Utils.isBase64Url(relativeUrl)) {
|
|
624
|
+
return relativeUrl;
|
|
625
|
+
}
|
|
626
|
+
return relativeUrl ? baseUrl.replace(/\/+$/, "") + "/" + relativeUrl.replace(/^\/+/, "") : baseUrl;
|
|
617
627
|
};
|
|
618
628
|
/**
|
|
619
629
|
* @internal
|
|
@@ -3169,7 +3179,7 @@ function _extends() {
|
|
|
3169
3179
|
return _extends.apply(this, arguments);
|
|
3170
3180
|
}
|
|
3171
3181
|
|
|
3172
|
-
var camera_declare = "#define GLSLIFY 1\nuniform vec3 camera_Position;"; // eslint-disable-line
|
|
3182
|
+
var camera_declare = "#define GLSLIFY 1\nuniform vec3 camera_Position;uniform vec3 camera_Forward;"; // eslint-disable-line
|
|
3173
3183
|
|
|
3174
3184
|
var common = "#define GLSLIFY 1\n#define PI 3.14159265359\n#define RECIPROCAL_PI 0.31830988618\n#define EPSILON 1e-6\n#define LOG2 1.442695\n#define saturate( a ) clamp( a, 0.0, 1.0 )\nfloat pow2(float x){return x*x;}vec4 RGBMToLinear(vec4 value,float maxRange){return vec4(value.rgb*value.a*maxRange,1.0);}vec4 gammaToLinear(vec4 srgbIn){return vec4(pow(srgbIn.rgb,vec3(2.2)),srgbIn.a);}vec4 linearToGamma(vec4 linearIn){return vec4(pow(linearIn.rgb,vec3(1.0/2.2)),linearIn.a);}uniform vec4 camera_DepthBufferParams;float remapDepthBufferLinear01(float z){return 1.0/(camera_DepthBufferParams.x*z+camera_DepthBufferParams.y);}\n#ifdef GRAPHICS_API_WEBGL2\n#define INVERSE_MAT(mat) inverse(mat)\n#else\nmat2 inverseMat(mat2 m){return mat2(m[1][1],-m[0][1],-m[1][0],m[0][0])/(m[0][0]*m[1][1]-m[0][1]*m[1][0]);}mat3 inverseMat(mat3 m){float a00=m[0][0],a01=m[0][1],a02=m[0][2];float a10=m[1][0],a11=m[1][1],a12=m[1][2];float a20=m[2][0],a21=m[2][1],a22=m[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),b11,(a22*a00-a02*a20),(-a12*a00+a02*a10),b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}mat4 inverseMat(mat4 m){float a00=m[0][0],a01=m[0][1],a02=m[0][2],a03=m[0][3],a10=m[1][0],a11=m[1][1],a12=m[1][2],a13=m[1][3],a20=m[2][0],a21=m[2][1],a22=m[2][2],a23=m[2][3],a30=m[3][0],a31=m[3][1],a32=m[3][2],a33=m[3][3],b00=a00*a11-a01*a10,b01=a00*a12-a02*a10,b02=a00*a13-a03*a10,b03=a01*a12-a02*a11,b04=a01*a13-a03*a11,b05=a02*a13-a03*a12,b06=a20*a31-a21*a30,b07=a20*a32-a22*a30,b08=a20*a33-a23*a30,b09=a21*a32-a22*a31,b10=a21*a33-a23*a31,b11=a22*a33-a23*a32,det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;return mat4(a11*b11-a12*b10+a13*b09,a02*b10-a01*b11-a03*b09,a31*b05-a32*b04+a33*b03,a22*b04-a21*b05-a23*b03,a12*b08-a10*b11-a13*b07,a00*b11-a02*b08+a03*b07,a32*b02-a30*b05-a33*b01,a20*b05-a22*b02+a23*b01,a10*b10-a11*b08+a13*b06,a01*b08-a00*b10-a03*b06,a30*b04-a31*b02+a33*b00,a21*b02-a20*b04-a23*b00,a11*b07-a10*b09-a12*b06,a00*b09-a01*b07+a02*b06,a31*b01-a30*b03-a32*b00,a20*b03-a21*b01+a22*b00)/det;}\n#define INVERSE_MAT(mat) inverseMat(mat)\n#endif\n"; // eslint-disable-line
|
|
3175
3185
|
|
|
@@ -3219,7 +3229,7 @@ var mobile_material_frag = "#define GLSLIFY 1\nuniform vec4 material_EmissiveCol
|
|
|
3219
3229
|
|
|
3220
3230
|
var begin_mobile_frag = "#define GLSLIFY 1\nvec4 ambient=vec4(0.0);vec4 emission=material_EmissiveColor;vec4 diffuse=material_BaseColor;vec4 specular=material_SpecularColor;\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\nvec4 emissiveTextureColor=texture2D(material_EmissiveTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nemissiveTextureColor=gammaToLinear(emissiveTextureColor);\n#endif\nemission*=emissiveTextureColor;\n#endif\n#ifdef MATERIAL_HAS_BASETEXTURE\nvec4 diffuseTextureColor=texture2D(material_BaseTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\ndiffuseTextureColor=gammaToLinear(diffuseTextureColor);\n#endif\ndiffuse*=diffuseTextureColor;\n#endif\n#ifdef RENDERER_ENABLE_VERTEXCOLOR\ndiffuse*=v_color;\n#endif\n#ifdef MATERIAL_HAS_SPECULAR_TEXTURE\nvec4 specularTextureColor=texture2D(material_SpecularTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nspecularTextureColor=gammaToLinear(specularTextureColor);\n#endif\nspecular*=specularTextureColor;\n#endif\nambient=vec4(scene_EnvMapLight.diffuse*scene_EnvMapLight.diffuseIntensity,1.0)*diffuse;"; // eslint-disable-line
|
|
3221
3231
|
|
|
3222
|
-
var begin_viewdir_frag = "#define GLSLIFY 1\n#ifdef MATERIAL_NEED_WORLD_POS\nvec3 V=normalize(camera_Position-v_pos);\n#endif\n"; // eslint-disable-line
|
|
3232
|
+
var begin_viewdir_frag = "#define GLSLIFY 1\n#ifdef CAMERA_ORTHOGRAPHIC\nvec3 V=-camera_Forward;\n#else\n#ifdef MATERIAL_NEED_WORLD_POS\nvec3 V=normalize(camera_Position-v_pos);\n#endif\n#endif\n"; // eslint-disable-line
|
|
3223
3233
|
|
|
3224
3234
|
var mobile_blinnphong_frag = "#define GLSLIFY 1\n#ifdef MATERIAL_HAS_NORMALTEXTURE\nmat3 tbn=getTBN(gl_FrontFacing);vec3 N=getNormalByNormalTexture(tbn,material_NormalTexture,material_NormalIntensity,v_uv,gl_FrontFacing);\n#else\nvec3 N=getNormal(gl_FrontFacing);\n#endif\nvec3 lightDiffuse=vec3(0.0,0.0,0.0);vec3 lightSpecular=vec3(0.0,0.0,0.0);float shadowAttenuation=1.0;\n#ifdef SCENE_DIRECT_LIGHT_COUNT\nshadowAttenuation=1.0;\n#ifdef SCENE_IS_CALCULATE_SHADOWS\nshadowAttenuation*=sampleShadowMap();\n#endif\nDirectLight directionalLight;for(int i=0;i<SCENE_DIRECT_LIGHT_COUNT;i++){if(!isRendererCulledByLight(renderer_Layer.xy,scene_DirectLightCullingMask[i])){directionalLight.color=scene_DirectLightColor[i];\n#ifdef SCENE_IS_CALCULATE_SHADOWS\nif(i==0){directionalLight.color*=shadowAttenuation;}\n#endif\ndirectionalLight.direction=scene_DirectLightDirection[i];float d=max(dot(N,-directionalLight.direction),0.0);lightDiffuse+=directionalLight.color*d;vec3 halfDir=normalize(V-directionalLight.direction);float s=pow(clamp(dot(N,halfDir),0.0,1.0),material_Shininess);lightSpecular+=directionalLight.color*s;}}\n#endif\n#ifdef SCENE_POINT_LIGHT_COUNT\nPointLight pointLight;for(int i=0;i<SCENE_POINT_LIGHT_COUNT;i++){if(!isRendererCulledByLight(renderer_Layer.xy,scene_PointLightCullingMask[i])){pointLight.color=scene_PointLightColor[i];pointLight.position=scene_PointLightPosition[i];pointLight.distance=scene_PointLightDistance[i];vec3 direction=v_pos-pointLight.position;float dist=length(direction);direction/=dist;float decay=clamp(1.0-pow(dist/pointLight.distance,4.0),0.0,1.0);float d=max(dot(N,-direction),0.0)*decay;lightDiffuse+=pointLight.color*d;vec3 halfDir=normalize(V-direction);float s=pow(clamp(dot(N,halfDir),0.0,1.0),material_Shininess)*decay;lightSpecular+=pointLight.color*s;}}\n#endif\n#ifdef SCENE_SPOT_LIGHT_COUNT\nSpotLight spotLight;for(int i=0;i<SCENE_SPOT_LIGHT_COUNT;i++){if(!isRendererCulledByLight(renderer_Layer.xy,scene_SpotLightCullingMask[i])){spotLight.color=scene_SpotLightColor[i];spotLight.position=scene_SpotLightPosition[i];spotLight.direction=scene_SpotLightDirection[i];spotLight.distance=scene_SpotLightDistance[i];spotLight.angleCos=scene_SpotLightAngleCos[i];spotLight.penumbraCos=scene_SpotLightPenumbraCos[i];vec3 direction=spotLight.position-v_pos;float lightDistance=length(direction);direction/=lightDistance;float angleCos=dot(direction,-spotLight.direction);float decay=clamp(1.0-pow(lightDistance/spotLight.distance,4.0),0.0,1.0);float spotEffect=smoothstep(spotLight.penumbraCos,spotLight.angleCos,angleCos);float decayTotal=decay*spotEffect;float d=max(dot(N,direction),0.0)*decayTotal;lightDiffuse+=spotLight.color*d;vec3 halfDir=normalize(V+direction);float s=pow(clamp(dot(N,halfDir),0.0,1.0),material_Shininess)*decayTotal;lightSpecular+=spotLight.color*s;}}\n#endif\ndiffuse*=vec4(lightDiffuse,1.0);specular*=vec4(lightSpecular,1.0);\n#ifdef MATERIAL_IS_ALPHA_CUTOFF\nif(diffuse.a<material_AlphaCutoff){discard;}\n#endif\n"; // eslint-disable-line
|
|
3225
3235
|
|
|
@@ -3257,7 +3267,7 @@ var noise_simplex_4D = "#define GLSLIFY 1\nvec4 grad4(float j,vec4 ip){const vec
|
|
|
3257
3267
|
|
|
3258
3268
|
var pbr_frag_define = "#define GLSLIFY 1\n#define MIN_PERCEPTUAL_ROUGHNESS 0.045\n#define MIN_ROUGHNESS 0.002025\nuniform float material_AlphaCutoff;uniform vec4 material_BaseColor;uniform float material_Metal;uniform float material_Roughness;uniform float material_IOR;uniform vec3 material_PBRSpecularColor;uniform float material_Glossiness;uniform vec3 material_EmissiveColor;uniform float material_NormalIntensity;uniform float material_OcclusionIntensity;uniform float material_OcclusionTextureCoord;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nuniform float material_ClearCoat;uniform float material_ClearCoatRoughness;\n#ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\nuniform sampler2D material_ClearCoatTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\nuniform sampler2D material_ClearCoatRoughnessTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\nuniform sampler2D material_ClearCoatNormalTexture;\n#endif\n#endif\n#ifdef MATERIAL_ENABLE_ANISOTROPY\nuniform vec3 material_AnisotropyInfo;\n#ifdef MATERIAL_HAS_ANISOTROPY_TEXTURE\nuniform sampler2D material_AnisotropyTexture;\n#endif\n#endif\n#ifdef MATERIAL_HAS_BASETEXTURE\nuniform sampler2D material_BaseTexture;\n#endif\n#ifdef MATERIAL_HAS_NORMALTEXTURE\nuniform sampler2D material_NormalTexture;\n#endif\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\nuniform sampler2D material_EmissiveTexture;\n#endif\n#ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\nuniform sampler2D material_RoughnessMetallicTexture;\n#endif\n#ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\nuniform sampler2D material_SpecularGlossinessTexture;\n#endif\n#ifdef MATERIAL_HAS_OCCLUSION_TEXTURE\nuniform sampler2D material_OcclusionTexture;\n#endif\nstruct ReflectedLight{vec3 directDiffuse;vec3 directSpecular;vec3 indirectDiffuse;vec3 indirectSpecular;};struct Geometry{vec3 position;vec3 normal;vec3 viewDir;float dotNV;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nvec3 clearCoatNormal;float clearCoatDotNV;\n#endif\n#ifdef MATERIAL_ENABLE_ANISOTROPY\nvec3 anisotropicT;vec3 anisotropicB;vec3 anisotropicN;float anisotropy;\n#endif\n};struct Material{vec3 diffuseColor;float roughness;vec3 specularColor;float opacity;float f0;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nfloat clearCoat;float clearCoatRoughness;\n#endif\n};"; // eslint-disable-line
|
|
3259
3269
|
|
|
3260
|
-
var pbr_helper = "#define GLSLIFY 1\n#include <normal_get>\nfloat computeSpecularOcclusion(float ambientOcclusion,float roughness,float dotNV){return saturate(pow(dotNV+ambientOcclusion,exp2(-16.0*roughness-1.0))-1.0+ambientOcclusion);}float getAARoughnessFactor(vec3 normal){\n#ifdef HAS_DERIVATIVES\nvec3 dxy=max(abs(dFdx(normal)),abs(dFdy(normal)));return MIN_PERCEPTUAL_ROUGHNESS+max(max(dxy.x,dxy.y),dxy.z);\n#else\nreturn MIN_PERCEPTUAL_ROUGHNESS;\n#endif\n}\n#ifdef MATERIAL_ENABLE_ANISOTROPY\nvec3 getAnisotropicBentNormal(Geometry geometry,vec3 n,float roughness){vec3 anisotropyDirection=geometry.anisotropy>=0.0 ? geometry.anisotropicB : geometry.anisotropicT;vec3 anisotropicTangent=cross(anisotropyDirection,geometry.viewDir);vec3 anisotropicNormal=cross(anisotropicTangent,anisotropyDirection);vec3 bentNormal=normalize(mix(n,anisotropicNormal,abs(geometry.anisotropy)*saturate(5.0*roughness)));return bentNormal;}\n#endif\nvoid initGeometry(out Geometry geometry,bool isFrontFacing){geometry.position=v_pos
|
|
3270
|
+
var pbr_helper = "#define GLSLIFY 1\n#include <normal_get>\nfloat computeSpecularOcclusion(float ambientOcclusion,float roughness,float dotNV){return saturate(pow(dotNV+ambientOcclusion,exp2(-16.0*roughness-1.0))-1.0+ambientOcclusion);}float getAARoughnessFactor(vec3 normal){\n#ifdef HAS_DERIVATIVES\nvec3 dxy=max(abs(dFdx(normal)),abs(dFdy(normal)));return MIN_PERCEPTUAL_ROUGHNESS+max(max(dxy.x,dxy.y),dxy.z);\n#else\nreturn MIN_PERCEPTUAL_ROUGHNESS;\n#endif\n}\n#ifdef MATERIAL_ENABLE_ANISOTROPY\nvec3 getAnisotropicBentNormal(Geometry geometry,vec3 n,float roughness){vec3 anisotropyDirection=geometry.anisotropy>=0.0 ? geometry.anisotropicB : geometry.anisotropicT;vec3 anisotropicTangent=cross(anisotropyDirection,geometry.viewDir);vec3 anisotropicNormal=cross(anisotropicTangent,anisotropyDirection);vec3 bentNormal=normalize(mix(n,anisotropicNormal,abs(geometry.anisotropy)*saturate(5.0*roughness)));return bentNormal;}\n#endif\nvoid initGeometry(out Geometry geometry,bool isFrontFacing){geometry.position=v_pos;\n#ifdef CAMERA_ORTHOGRAPHIC\ngeometry.viewDir=-camera_Forward;\n#else\ngeometry.viewDir=normalize(camera_Position-v_pos);\n#endif\n#if defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) || defined(MATERIAL_ENABLE_ANISOTROPY)\nmat3 tbn=getTBN(isFrontFacing);\n#endif\n#ifdef MATERIAL_HAS_NORMALTEXTURE\ngeometry.normal=getNormalByNormalTexture(tbn,material_NormalTexture,material_NormalIntensity,v_uv,isFrontFacing);\n#else\ngeometry.normal=getNormal(isFrontFacing);\n#endif\ngeometry.dotNV=saturate(dot(geometry.normal,geometry.viewDir));\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\n#ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\ngeometry.clearCoatNormal=getNormalByNormalTexture(tbn,material_ClearCoatNormalTexture,material_NormalIntensity,v_uv,isFrontFacing);\n#else\ngeometry.clearCoatNormal=getNormal(isFrontFacing);\n#endif\ngeometry.clearCoatDotNV=saturate(dot(geometry.clearCoatNormal,geometry.viewDir));\n#endif\n#ifdef MATERIAL_ENABLE_ANISOTROPY\nfloat anisotropy=material_AnisotropyInfo.z;vec3 anisotropicDirection=vec3(material_AnisotropyInfo.xy,0.0);\n#ifdef MATERIAL_HAS_ANISOTROPY_TEXTURE\nvec3 anisotropyTextureInfo=texture2D(material_AnisotropyTexture,v_uv).rgb;anisotropy*=anisotropyTextureInfo.b;anisotropicDirection.xy*=anisotropyTextureInfo.rg*2.0-1.0;\n#endif\ngeometry.anisotropy=anisotropy;geometry.anisotropicT=normalize(tbn*anisotropicDirection);geometry.anisotropicB=normalize(cross(geometry.normal,geometry.anisotropicT));\n#endif\n}void initMaterial(out Material material,inout Geometry geometry){vec4 baseColor=material_BaseColor;float metal=material_Metal;float roughness=material_Roughness;vec3 specularColor=material_PBRSpecularColor;float glossiness=material_Glossiness;float alphaCutoff=material_AlphaCutoff;float f0=pow2((material_IOR-1.0)/(material_IOR+1.0));material.f0=f0;\n#ifdef MATERIAL_HAS_BASETEXTURE\nvec4 baseTextureColor=texture2D(material_BaseTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nbaseTextureColor=gammaToLinear(baseTextureColor);\n#endif\nbaseColor*=baseTextureColor;\n#endif\n#ifdef RENDERER_ENABLE_VERTEXCOLOR\nbaseColor*=v_color;\n#endif\n#ifdef MATERIAL_IS_ALPHA_CUTOFF\nif(baseColor.a<alphaCutoff){discard;}\n#endif\n#ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\nvec4 metalRoughMapColor=texture2D(material_RoughnessMetallicTexture,v_uv);roughness*=metalRoughMapColor.g;metal*=metalRoughMapColor.b;\n#endif\n#ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\nvec4 specularGlossinessColor=texture2D(material_SpecularGlossinessTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nspecularGlossinessColor=gammaToLinear(specularGlossinessColor);\n#endif\nspecularColor*=specularGlossinessColor.rgb;glossiness*=specularGlossinessColor.a;\n#endif\n#ifdef IS_METALLIC_WORKFLOW\nmaterial.diffuseColor=baseColor.rgb*(1.0-metal);material.specularColor=mix(vec3(f0),baseColor.rgb,metal);material.roughness=roughness;\n#else\nfloat specularStrength=max(max(specularColor.r,specularColor.g),specularColor.b);material.diffuseColor=baseColor.rgb*(1.0-specularStrength);material.specularColor=specularColor;material.roughness=1.0-glossiness;\n#endif\nmaterial.roughness=max(material.roughness,getAARoughnessFactor(geometry.normal));\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nmaterial.clearCoat=material_ClearCoat;material.clearCoatRoughness=material_ClearCoatRoughness;\n#ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\nmaterial.clearCoat*=texture2D(material_ClearCoatTexture,v_uv).r;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\nmaterial.clearCoatRoughness*=texture2D(material_ClearCoatRoughnessTexture,v_uv).g;\n#endif\nmaterial.clearCoat=saturate(material.clearCoat);material.clearCoatRoughness=max(material.clearCoatRoughness,getAARoughnessFactor(geometry.clearCoatNormal));\n#endif\n#ifdef MATERIAL_IS_TRANSPARENT\nmaterial.opacity=baseColor.a;\n#else\nmaterial.opacity=1.0;\n#endif\n#ifdef MATERIAL_ENABLE_ANISOTROPY\ngeometry.anisotropicN=getAnisotropicBentNormal(geometry,geometry.normal,material.roughness);\n#endif\n}\n#include <brdf>\n#include <direct_irradiance_frag_define>\n#include <ibl_frag_define>\n"; // eslint-disable-line
|
|
3261
3271
|
|
|
3262
3272
|
var brdf = "#define GLSLIFY 1\nfloat F_Schlick(float f0,float dotLH){return f0+0.96*(pow(1.0-dotLH,5.0));}vec3 F_Schlick(vec3 specularColor,float dotLH){float fresnel=exp2((-5.55473*dotLH-6.98316)*dotLH);return(1.0-specularColor)*fresnel+specularColor;}float G_GGX_SmithCorrelated(float alpha,float dotNL,float dotNV){float a2=pow2(alpha);float gv=dotNL*sqrt(a2+(1.0-a2)*pow2(dotNV));float gl=dotNV*sqrt(a2+(1.0-a2)*pow2(dotNL));return 0.5/max(gv+gl,EPSILON);}\n#ifdef MATERIAL_ENABLE_ANISOTROPY\nfloat G_GGX_SmithCorrelated_Anisotropic(float at,float ab,float ToV,float BoV,float ToL,float BoL,float NoV,float NoL){float lambdaV=NoL*length(vec3(at*ToV,ab*BoV,NoV));float lambdaL=NoV*length(vec3(at*ToL,ab*BoL,NoL));return 0.5/max(lambdaV+lambdaL,EPSILON);}\n#endif\nfloat D_GGX(float alpha,float dotNH){float a2=pow2(alpha);float denom=pow2(dotNH)*(a2-1.0)+1.0;return RECIPROCAL_PI*a2/pow2(denom);}\n#ifdef MATERIAL_ENABLE_ANISOTROPY\nfloat D_GGX_Anisotropic(float at,float ab,float ToH,float BoH,float NoH){float a2=at*ab;highp vec3 d=vec3(ab*ToH,at*BoH,a2*NoH);highp float d2=dot(d,d);float b2=a2/d2;return a2*b2*b2*RECIPROCAL_PI;}\n#endif\nvec3 isotropicLobe(vec3 specularColor,float alpha,float dotNV,float dotNL,float dotNH,float dotLH){vec3 F=F_Schlick(specularColor,dotLH);float D=D_GGX(alpha,dotNH);float G=G_GGX_SmithCorrelated(alpha,dotNL,dotNV);return F*(G*D);}\n#ifdef MATERIAL_ENABLE_ANISOTROPY\nvec3 anisotropicLobe(vec3 h,vec3 l,Geometry geometry,vec3 specularColor,float alpha,float dotNV,float dotNL,float dotNH,float dotLH){vec3 t=geometry.anisotropicT;vec3 b=geometry.anisotropicB;vec3 v=geometry.viewDir;float dotTV=dot(t,v);float dotBV=dot(b,v);float dotTL=dot(t,l);float dotBL=dot(b,l);float dotTH=dot(t,h);float dotBH=dot(b,h);float at=max(alpha*(1.0+geometry.anisotropy),MIN_ROUGHNESS);float ab=max(alpha*(1.0-geometry.anisotropy),MIN_ROUGHNESS);vec3 F=F_Schlick(specularColor,dotLH);float D=D_GGX_Anisotropic(at,ab,dotTH,dotBH,dotNH);float G=G_GGX_SmithCorrelated_Anisotropic(at,ab,dotTV,dotBV,dotTL,dotBL,dotNV,dotNL);return F*(G*D);}\n#endif\nvec3 BRDF_Specular_GGX(vec3 incidentDirection,Geometry geometry,vec3 normal,vec3 specularColor,float roughness){float alpha=pow2(roughness);vec3 halfDir=normalize(incidentDirection+geometry.viewDir);float dotNL=saturate(dot(normal,incidentDirection));float dotNV=saturate(dot(normal,geometry.viewDir));float dotNH=saturate(dot(normal,halfDir));float dotLH=saturate(dot(incidentDirection,halfDir));\n#ifdef MATERIAL_ENABLE_ANISOTROPY\nreturn anisotropicLobe(halfDir,incidentDirection,geometry,specularColor,alpha,dotNV,dotNL,dotNH,dotLH);\n#else\nreturn isotropicLobe(specularColor,alpha,dotNV,dotNL,dotNH,dotLH);\n#endif\n}vec3 BRDF_Diffuse_Lambert(vec3 diffuseColor){return RECIPROCAL_PI*diffuseColor;}"; // eslint-disable-line
|
|
3263
3273
|
|
|
@@ -3393,7 +3403,11 @@ var ShaderFactory = /*#__PURE__*/ function() {
|
|
|
3393
3403
|
}
|
|
3394
3404
|
ShaderLib[includeName] = includeSource;
|
|
3395
3405
|
};
|
|
3396
|
-
|
|
3406
|
+
/**
|
|
3407
|
+
* @param regex The default regex is for engine's builtin glsl `#include` syntax,
|
|
3408
|
+
* since `ShaderLab` use the same parsing function but different syntax for `#include` --- `/^[ \t]*#include +"([\w\d.]+)"/gm`
|
|
3409
|
+
*/ ShaderFactory.parseIncludes = function parseIncludes(src, regex) {
|
|
3410
|
+
if (regex === void 0) regex = /^[ \t]*#include +<([\w\d.]+)>/gm;
|
|
3397
3411
|
var replace = function replace(match, slice) {
|
|
3398
3412
|
var replace = ShaderLib[slice];
|
|
3399
3413
|
if (replace === undefined) {
|
|
@@ -3402,7 +3416,6 @@ var ShaderFactory = /*#__PURE__*/ function() {
|
|
|
3402
3416
|
}
|
|
3403
3417
|
return ShaderFactory.parseIncludes(replace);
|
|
3404
3418
|
};
|
|
3405
|
-
var regex = /^[ \t]*#include +<([\w\d.]+)>/gm;
|
|
3406
3419
|
return src.replace(regex, replace);
|
|
3407
3420
|
};
|
|
3408
3421
|
/**
|
|
@@ -6384,7 +6397,7 @@ SlicedSpriteAssembler = __decorate([
|
|
|
6384
6397
|
_this._byteLength = byteLength;
|
|
6385
6398
|
_this._platformBuffer = engine._hardwareRenderer.createPlatformBuffer(type, byteLength, bufferUsage, data);
|
|
6386
6399
|
if (readable) {
|
|
6387
|
-
var buffer =
|
|
6400
|
+
var buffer = data.constructor === ArrayBuffer ? data.slice(0) : data.buffer.slice(data.byteOffset, data.byteOffset + byteLength);
|
|
6388
6401
|
_this._data = new Uint8Array(buffer);
|
|
6389
6402
|
}
|
|
6390
6403
|
}
|
|
@@ -12879,6 +12892,9 @@ var /**
|
|
|
12879
12892
|
var baseline = Math.ceil(context.measureText(TextUtils._measureBaseline).width);
|
|
12880
12893
|
var height = baseline * TextUtils._heightMultiplier;
|
|
12881
12894
|
baseline = TextUtils._baselineMultiplier * baseline | 0;
|
|
12895
|
+
var _extendHeight = TextUtils._extendHeight;
|
|
12896
|
+
height += _extendHeight;
|
|
12897
|
+
baseline += _extendHeight * 0.5;
|
|
12882
12898
|
canvas.width = width;
|
|
12883
12899
|
canvas.height = height;
|
|
12884
12900
|
context.font = fontString;
|
|
@@ -12913,6 +12929,7 @@ var /**
|
|
|
12913
12929
|
}
|
|
12914
12930
|
if (top !== -1 && bottom !== -1) {
|
|
12915
12931
|
ascent = baseline - top;
|
|
12932
|
+
// Baseline belong to descent
|
|
12916
12933
|
descent = bottom - baseline + 1;
|
|
12917
12934
|
size = ascent + descent;
|
|
12918
12935
|
}
|
|
@@ -12989,9 +13006,8 @@ var /**
|
|
|
12989
13006
|
];
|
|
12990
13007
|
})();
|
|
12991
13008
|
(function() {
|
|
12992
|
-
//
|
|
12993
|
-
|
|
12994
|
-
/** @internal */ TextUtils._heightMultiplier = 2;
|
|
13009
|
+
// _extendHeight used to extend the height of canvas, because in miniprogram performance is different from h5.
|
|
13010
|
+
/** @internal */ TextUtils._extendHeight = 0;
|
|
12995
13011
|
})();
|
|
12996
13012
|
(function() {
|
|
12997
13013
|
/** These characters are all tall to help calculate the height required for text. */ TextUtils._measureString = "|\xc9q\xc5";
|
|
@@ -12999,6 +13015,9 @@ var /**
|
|
|
12999
13015
|
(function() {
|
|
13000
13016
|
TextUtils._measureBaseline = "M";
|
|
13001
13017
|
})();
|
|
13018
|
+
(function() {
|
|
13019
|
+
TextUtils._heightMultiplier = 2;
|
|
13020
|
+
})();
|
|
13002
13021
|
(function() {
|
|
13003
13022
|
TextUtils._baselineMultiplier = 1.4;
|
|
13004
13023
|
})();
|
|
@@ -14757,6 +14776,7 @@ var TextRenderData = /*#__PURE__*/ function(RenderData1) {
|
|
|
14757
14776
|
AssetType[/** Cube Compress Texture. */ "KTXCube"] = "KTXCube";
|
|
14758
14777
|
AssetType[/** KTX2 Compress Texture */ "KTX2"] = "KTX2";
|
|
14759
14778
|
AssetType[/** Sprite. */ "Sprite"] = "Sprite";
|
|
14779
|
+
AssetType[/** PrimitiveMesh. */ "PrimitiveMesh"] = "PrimitiveMesh";
|
|
14760
14780
|
AssetType[/** Sprite Atlas. */ "SpriteAtlas"] = "SpriteAtlas";
|
|
14761
14781
|
AssetType[/** Ambient light. */ "Env"] = "Environment";
|
|
14762
14782
|
AssetType[/** Scene. */ "Scene"] = "Scene";
|
|
@@ -15142,6 +15162,7 @@ var /** @internal */ PromiseState;
|
|
|
15142
15162
|
this./** The number of retries after failing to load assets. */ retryCount = 1;
|
|
15143
15163
|
this./** Retry delay time after failed to load assets, in milliseconds. */ retryInterval = 0;
|
|
15144
15164
|
this./** The default timeout period for loading assets, in milliseconds. */ timeout = Infinity;
|
|
15165
|
+
this./** Base url for loading assets. */ baseUrl = null;
|
|
15145
15166
|
this._loadingPromises = {};
|
|
15146
15167
|
this._assetPool = Object.create(null);
|
|
15147
15168
|
this._assetUrlPool = Object.create(null);
|
|
@@ -15345,6 +15366,8 @@ var /** @internal */ PromiseState;
|
|
|
15345
15366
|
// Check url mapping
|
|
15346
15367
|
var itemURL = item.url;
|
|
15347
15368
|
var url = this._virtualPathMap[itemURL] ? this._virtualPathMap[itemURL] : itemURL;
|
|
15369
|
+
// Not absolute and base url is set
|
|
15370
|
+
if (!Utils.isAbsoluteUrl(url) && this.baseUrl) url = Utils.resolveAbsoluteUrl(this.baseUrl, url);
|
|
15348
15371
|
// Parse url
|
|
15349
15372
|
var _this__parseURL = this._parseURL(url), assetBaseURL = _this__parseURL.assetBaseURL, queryPath = _this__parseURL.queryPath;
|
|
15350
15373
|
var paths = queryPath ? this._parseQueryPath(queryPath) : [];
|
|
@@ -16035,7 +16058,7 @@ SystemInfo._initialize();
|
|
|
16035
16058
|
* Keyboard Manager.
|
|
16036
16059
|
* @internal
|
|
16037
16060
|
*/ var KeyboardManager = /*#__PURE__*/ function() {
|
|
16038
|
-
function KeyboardManager(engine) {
|
|
16061
|
+
function KeyboardManager(engine, target) {
|
|
16039
16062
|
/** @internal */ this._curHeldDownKeyToIndexMap = [];
|
|
16040
16063
|
/** @internal */ this._upKeyToFrameCountMap = [];
|
|
16041
16064
|
/** @internal */ this._downKeyToFrameCountMap = [];
|
|
@@ -16043,17 +16066,11 @@ SystemInfo._initialize();
|
|
|
16043
16066
|
/** @internal */ this._curFrameDownList = new DisorderedArray();
|
|
16044
16067
|
/** @internal */ this._curFrameUpList = new DisorderedArray();
|
|
16045
16068
|
this._nativeEvents = [];
|
|
16046
|
-
this._hadListener = false;
|
|
16047
|
-
// @ts-ignore
|
|
16048
|
-
var htmlCanvas = engine._canvas._webCanvas;
|
|
16049
16069
|
this._engine = engine;
|
|
16050
|
-
this.
|
|
16051
|
-
// Need to set tabIndex to make the canvas focus.
|
|
16052
|
-
htmlCanvas.tabIndex = htmlCanvas.tabIndex;
|
|
16070
|
+
this._onBlur = this._onBlur.bind(this);
|
|
16053
16071
|
this._onKeyEvent = this._onKeyEvent.bind(this);
|
|
16054
|
-
|
|
16055
|
-
|
|
16056
|
-
this._hadListener = true;
|
|
16072
|
+
this._target = target;
|
|
16073
|
+
this._addEventListener();
|
|
16057
16074
|
}
|
|
16058
16075
|
var _proto = KeyboardManager.prototype;
|
|
16059
16076
|
/**
|
|
@@ -16105,35 +16122,8 @@ SystemInfo._initialize();
|
|
|
16105
16122
|
};
|
|
16106
16123
|
/**
|
|
16107
16124
|
* @internal
|
|
16108
|
-
*/ _proto._onFocus = function _onFocus() {
|
|
16109
|
-
if (!this._hadListener) {
|
|
16110
|
-
this._htmlCanvas.addEventListener("keydown", this._onKeyEvent);
|
|
16111
|
-
this._htmlCanvas.addEventListener("keyup", this._onKeyEvent);
|
|
16112
|
-
this._hadListener = true;
|
|
16113
|
-
}
|
|
16114
|
-
};
|
|
16115
|
-
/**
|
|
16116
|
-
* @internal
|
|
16117
|
-
*/ _proto._onBlur = function _onBlur() {
|
|
16118
|
-
if (this._hadListener) {
|
|
16119
|
-
this._htmlCanvas.removeEventListener("keydown", this._onKeyEvent);
|
|
16120
|
-
this._htmlCanvas.removeEventListener("keyup", this._onKeyEvent);
|
|
16121
|
-
this._curHeldDownKeyToIndexMap.length = 0;
|
|
16122
|
-
this._curFrameHeldDownList.length = 0;
|
|
16123
|
-
this._curFrameDownList.length = 0;
|
|
16124
|
-
this._curFrameUpList.length = 0;
|
|
16125
|
-
this._nativeEvents.length = 0;
|
|
16126
|
-
this._hadListener = false;
|
|
16127
|
-
}
|
|
16128
|
-
};
|
|
16129
|
-
/**
|
|
16130
|
-
* @internal
|
|
16131
16125
|
*/ _proto._destroy = function _destroy() {
|
|
16132
|
-
|
|
16133
|
-
this._htmlCanvas.removeEventListener("keydown", this._onKeyEvent);
|
|
16134
|
-
this._htmlCanvas.removeEventListener("keyup", this._onKeyEvent);
|
|
16135
|
-
this._hadListener = false;
|
|
16136
|
-
}
|
|
16126
|
+
this._removeEventListener();
|
|
16137
16127
|
this._curHeldDownKeyToIndexMap.length = 0;
|
|
16138
16128
|
this._curHeldDownKeyToIndexMap = null;
|
|
16139
16129
|
this._upKeyToFrameCountMap.length = 0;
|
|
@@ -16148,12 +16138,30 @@ SystemInfo._initialize();
|
|
|
16148
16138
|
this._curFrameDownList = null;
|
|
16149
16139
|
this._curFrameUpList.length = 0;
|
|
16150
16140
|
this._curFrameUpList = null;
|
|
16151
|
-
this._htmlCanvas = null;
|
|
16152
16141
|
this._engine = null;
|
|
16153
16142
|
};
|
|
16143
|
+
_proto._onBlur = function _onBlur() {
|
|
16144
|
+
this._curHeldDownKeyToIndexMap.length = 0;
|
|
16145
|
+
this._curFrameHeldDownList.length = 0;
|
|
16146
|
+
this._curFrameDownList.length = 0;
|
|
16147
|
+
this._curFrameUpList.length = 0;
|
|
16148
|
+
this._nativeEvents.length = 0;
|
|
16149
|
+
};
|
|
16154
16150
|
_proto._onKeyEvent = function _onKeyEvent(evt) {
|
|
16155
16151
|
this._nativeEvents.push(evt);
|
|
16156
16152
|
};
|
|
16153
|
+
_proto._addEventListener = function _addEventListener() {
|
|
16154
|
+
var _this = this, target = _this._target;
|
|
16155
|
+
target.addEventListener("keydown", this._onKeyEvent);
|
|
16156
|
+
target.addEventListener("keyup", this._onKeyEvent);
|
|
16157
|
+
target.addEventListener("blur", this._onBlur);
|
|
16158
|
+
};
|
|
16159
|
+
_proto._removeEventListener = function _removeEventListener() {
|
|
16160
|
+
var _this = this, target = _this._target;
|
|
16161
|
+
target.removeEventListener("keydown", this._onKeyEvent);
|
|
16162
|
+
target.removeEventListener("keyup", this._onKeyEvent);
|
|
16163
|
+
target.removeEventListener("blur", this._onBlur);
|
|
16164
|
+
};
|
|
16157
16165
|
return KeyboardManager;
|
|
16158
16166
|
}();
|
|
16159
16167
|
|
|
@@ -18117,7 +18125,7 @@ __decorate([
|
|
|
18117
18125
|
* Pointer Manager.
|
|
18118
18126
|
* @internal
|
|
18119
18127
|
*/ var PointerManager = /*#__PURE__*/ function() {
|
|
18120
|
-
function PointerManager(engine) {
|
|
18128
|
+
function PointerManager(engine, target) {
|
|
18121
18129
|
/** @internal */ this._pointers = [];
|
|
18122
18130
|
/** @internal */ this._multiPointerEnabled = true;
|
|
18123
18131
|
/** @internal */ this._buttons = PointerButton.None;
|
|
@@ -18126,16 +18134,18 @@ __decorate([
|
|
|
18126
18134
|
/** @internal */ this._upList = new DisorderedArray();
|
|
18127
18135
|
/** @internal */ this._downList = new DisorderedArray();
|
|
18128
18136
|
this._nativeEvents = [];
|
|
18129
|
-
|
|
18130
|
-
|
|
18131
|
-
|
|
18137
|
+
if (_instanceof(target, Window)) {
|
|
18138
|
+
throw "Do not set window as target because window cannot listen to pointer leave event.";
|
|
18139
|
+
}
|
|
18132
18140
|
this._engine = engine;
|
|
18141
|
+
this._target = target;
|
|
18133
18142
|
this._canvas = engine.canvas;
|
|
18134
|
-
|
|
18135
|
-
this.
|
|
18136
|
-
this._onFocus();
|
|
18143
|
+
// @ts-ignore
|
|
18144
|
+
this._htmlCanvas = engine._canvas._webCanvas;
|
|
18137
18145
|
// If there are no compatibility issues, navigator.maxTouchPoints should be used here
|
|
18138
18146
|
this._pointerPool = new Array(11);
|
|
18147
|
+
this._onPointerEvent = this._onPointerEvent.bind(this);
|
|
18148
|
+
this._addEventListener();
|
|
18139
18149
|
}
|
|
18140
18150
|
var _proto = PointerManager.prototype;
|
|
18141
18151
|
/**
|
|
@@ -18205,7 +18215,8 @@ __decorate([
|
|
|
18205
18215
|
var length = events.length;
|
|
18206
18216
|
if (length > 0) {
|
|
18207
18217
|
for(var i1 = 0; i1 < length; i1++){
|
|
18208
|
-
|
|
18218
|
+
var event = events[i1];
|
|
18219
|
+
switch(event.type){
|
|
18209
18220
|
case "pointerdown":
|
|
18210
18221
|
pointer.phase = PointerPhase.Down;
|
|
18211
18222
|
pointer._firePointerDown(rayCastEntity);
|
|
@@ -18227,66 +18238,14 @@ __decorate([
|
|
|
18227
18238
|
};
|
|
18228
18239
|
/**
|
|
18229
18240
|
* @internal
|
|
18230
|
-
*/ _proto._onFocus = function _onFocus() {
|
|
18231
|
-
if (!this._hadListener) {
|
|
18232
|
-
var _this = this, htmlCanvas = _this._htmlCanvas, onPointerEvent = _this._onPointerEvent;
|
|
18233
|
-
htmlCanvas.addEventListener("pointerdown", onPointerEvent);
|
|
18234
|
-
htmlCanvas.addEventListener("pointerup", onPointerEvent);
|
|
18235
|
-
htmlCanvas.addEventListener("pointerleave", onPointerEvent);
|
|
18236
|
-
htmlCanvas.addEventListener("pointermove", onPointerEvent);
|
|
18237
|
-
htmlCanvas.addEventListener("pointercancel", onPointerEvent);
|
|
18238
|
-
this._hadListener = true;
|
|
18239
|
-
}
|
|
18240
|
-
};
|
|
18241
|
-
/**
|
|
18242
|
-
* @internal
|
|
18243
|
-
*/ _proto._onBlur = function _onBlur() {
|
|
18244
|
-
if (this._hadListener) {
|
|
18245
|
-
var _this = this, htmlCanvas = _this._htmlCanvas, onPointerEvent = _this._onPointerEvent;
|
|
18246
|
-
htmlCanvas.removeEventListener("pointerdown", onPointerEvent);
|
|
18247
|
-
htmlCanvas.removeEventListener("pointerup", onPointerEvent);
|
|
18248
|
-
htmlCanvas.removeEventListener("pointerleave", onPointerEvent);
|
|
18249
|
-
htmlCanvas.removeEventListener("pointermove", onPointerEvent);
|
|
18250
|
-
htmlCanvas.removeEventListener("pointercancel", onPointerEvent);
|
|
18251
|
-
this._hadListener = false;
|
|
18252
|
-
this._pointers.length = 0;
|
|
18253
|
-
this._downList.length = 0;
|
|
18254
|
-
this._upList.length = 0;
|
|
18255
|
-
}
|
|
18256
|
-
};
|
|
18257
|
-
/**
|
|
18258
|
-
* @internal
|
|
18259
18241
|
*/ _proto._destroy = function _destroy() {
|
|
18260
|
-
|
|
18261
|
-
if (this._hadListener) {
|
|
18262
|
-
var _this = this, htmlCanvas = _this._htmlCanvas, onPointerEvent = _this._onPointerEvent;
|
|
18263
|
-
htmlCanvas.removeEventListener("pointerdown", onPointerEvent);
|
|
18264
|
-
htmlCanvas.removeEventListener("pointerup", onPointerEvent);
|
|
18265
|
-
htmlCanvas.removeEventListener("pointerleave", onPointerEvent);
|
|
18266
|
-
htmlCanvas.removeEventListener("pointermove", onPointerEvent);
|
|
18267
|
-
htmlCanvas.removeEventListener("pointercancel", onPointerEvent);
|
|
18268
|
-
this._hadListener = false;
|
|
18269
|
-
}
|
|
18242
|
+
this._removeEventListener();
|
|
18270
18243
|
this._pointerPool.length = 0;
|
|
18271
|
-
this._pointerPool = null;
|
|
18272
|
-
this._pointers.length = 0;
|
|
18273
|
-
this._pointers = null;
|
|
18274
|
-
this._downList.length = 0;
|
|
18275
|
-
this._downList = null;
|
|
18276
|
-
this._upList.length = 0;
|
|
18277
|
-
this._upList = null;
|
|
18278
18244
|
this._nativeEvents.length = 0;
|
|
18279
|
-
this._nativeEvents = null;
|
|
18280
|
-
this._upMap.length = 0;
|
|
18281
|
-
this._upMap = null;
|
|
18282
18245
|
this._downMap.length = 0;
|
|
18283
|
-
this.
|
|
18284
|
-
this._htmlCanvas = null;
|
|
18285
|
-
this._canvas = null;
|
|
18286
|
-
this._engine = null;
|
|
18246
|
+
this._upMap.length = 0;
|
|
18287
18247
|
};
|
|
18288
18248
|
_proto._onPointerEvent = function _onPointerEvent(evt) {
|
|
18289
|
-
evt.type === "pointerdown" && this._htmlCanvas.focus();
|
|
18290
18249
|
this._nativeEvents.push(evt);
|
|
18291
18250
|
};
|
|
18292
18251
|
_proto._getPointerByID = function _getPointerByID(pointerId) {
|
|
@@ -18369,6 +18328,26 @@ __decorate([
|
|
|
18369
18328
|
}
|
|
18370
18329
|
return null;
|
|
18371
18330
|
};
|
|
18331
|
+
_proto._addEventListener = function _addEventListener() {
|
|
18332
|
+
var _this = this, target = _this._target, onPointerEvent = _this._onPointerEvent;
|
|
18333
|
+
target.addEventListener("pointerdown", onPointerEvent);
|
|
18334
|
+
target.addEventListener("pointerup", onPointerEvent);
|
|
18335
|
+
target.addEventListener("pointerleave", onPointerEvent);
|
|
18336
|
+
target.addEventListener("pointermove", onPointerEvent);
|
|
18337
|
+
target.addEventListener("pointercancel", onPointerEvent);
|
|
18338
|
+
};
|
|
18339
|
+
_proto._removeEventListener = function _removeEventListener() {
|
|
18340
|
+
var _this = this, target = _this._target, onPointerEvent = _this._onPointerEvent;
|
|
18341
|
+
target.removeEventListener("pointerdown", onPointerEvent);
|
|
18342
|
+
target.removeEventListener("pointerup", onPointerEvent);
|
|
18343
|
+
target.removeEventListener("pointerleave", onPointerEvent);
|
|
18344
|
+
target.removeEventListener("pointermove", onPointerEvent);
|
|
18345
|
+
target.removeEventListener("pointercancel", onPointerEvent);
|
|
18346
|
+
this._nativeEvents.length = 0;
|
|
18347
|
+
this._pointers.length = 0;
|
|
18348
|
+
this._downList.length = 0;
|
|
18349
|
+
this._upList.length = 0;
|
|
18350
|
+
};
|
|
18372
18351
|
return PointerManager;
|
|
18373
18352
|
}();
|
|
18374
18353
|
(function() {
|
|
@@ -18385,15 +18364,12 @@ __decorate([
|
|
|
18385
18364
|
* Wheel Manager.
|
|
18386
18365
|
* @internal
|
|
18387
18366
|
*/ var WheelManager = /*#__PURE__*/ function() {
|
|
18388
|
-
function WheelManager(engine) {
|
|
18367
|
+
function WheelManager(engine, target) {
|
|
18389
18368
|
/** @internal */ this._delta = new Vector3();
|
|
18390
18369
|
this._nativeEvents = [];
|
|
18391
|
-
// @ts-ignore
|
|
18392
|
-
var htmlCanvas = engine._canvas._webCanvas;
|
|
18393
18370
|
this._onWheelEvent = this._onWheelEvent.bind(this);
|
|
18394
|
-
|
|
18395
|
-
this.
|
|
18396
|
-
this._hadListener = true;
|
|
18371
|
+
this._target = target;
|
|
18372
|
+
this._addEventListener();
|
|
18397
18373
|
}
|
|
18398
18374
|
var _proto = WheelManager.prototype;
|
|
18399
18375
|
/**
|
|
@@ -18414,35 +18390,24 @@ __decorate([
|
|
|
18414
18390
|
};
|
|
18415
18391
|
/**
|
|
18416
18392
|
* @internal
|
|
18417
|
-
*/ _proto.
|
|
18418
|
-
|
|
18419
|
-
this._canvas.addEventListener("wheel", this._onWheelEvent);
|
|
18420
|
-
this._hadListener = true;
|
|
18421
|
-
}
|
|
18393
|
+
*/ _proto._addEventListener = function _addEventListener() {
|
|
18394
|
+
this._target.addEventListener("wheel", this._onWheelEvent);
|
|
18422
18395
|
};
|
|
18423
18396
|
/**
|
|
18424
18397
|
* @internal
|
|
18425
|
-
*/ _proto.
|
|
18426
|
-
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
this._delta.set(0, 0, 0);
|
|
18430
|
-
this._hadListener = false;
|
|
18431
|
-
}
|
|
18398
|
+
*/ _proto._removeEventListener = function _removeEventListener() {
|
|
18399
|
+
this._target.removeEventListener("wheel", this._onWheelEvent);
|
|
18400
|
+
this._nativeEvents.length = 0;
|
|
18401
|
+
this._delta.set(0, 0, 0);
|
|
18432
18402
|
};
|
|
18433
18403
|
/**
|
|
18434
18404
|
* @internal
|
|
18435
18405
|
*/ _proto._destroy = function _destroy() {
|
|
18436
|
-
|
|
18437
|
-
this._canvas.removeEventListener("wheel", this._onWheelEvent);
|
|
18438
|
-
this._hadListener = false;
|
|
18439
|
-
}
|
|
18406
|
+
this._removeEventListener();
|
|
18440
18407
|
this._nativeEvents = null;
|
|
18441
|
-
this._canvas = null;
|
|
18442
18408
|
this._delta = null;
|
|
18443
18409
|
};
|
|
18444
18410
|
_proto._onWheelEvent = function _onWheelEvent(evt) {
|
|
18445
|
-
evt.cancelable && evt.preventDefault();
|
|
18446
18411
|
this._nativeEvents.push(evt);
|
|
18447
18412
|
};
|
|
18448
18413
|
return WheelManager;
|
|
@@ -18451,19 +18416,19 @@ __decorate([
|
|
|
18451
18416
|
/**
|
|
18452
18417
|
* InputManager manages device input such as mouse, touch, keyboard, etc.
|
|
18453
18418
|
*/ var InputManager = /*#__PURE__*/ function() {
|
|
18454
|
-
function InputManager(engine) {
|
|
18419
|
+
function InputManager(engine, inputOptions) {
|
|
18455
18420
|
/** Sometimes the input module will not be initialized, such as off-screen rendering. */ this._initialized = false;
|
|
18456
18421
|
this._engine = engine;
|
|
18457
18422
|
// @ts-ignore
|
|
18458
18423
|
var canvas = engine._canvas._webCanvas;
|
|
18459
18424
|
if (typeof OffscreenCanvas === "undefined" || !_instanceof(canvas, OffscreenCanvas)) {
|
|
18460
|
-
|
|
18461
|
-
|
|
18462
|
-
this.
|
|
18463
|
-
|
|
18464
|
-
|
|
18465
|
-
|
|
18466
|
-
|
|
18425
|
+
var _inputOptions, _inputOptions1, _inputOptions2;
|
|
18426
|
+
var _inputOptions_wheelTarget;
|
|
18427
|
+
this._wheelManager = new WheelManager(engine, (_inputOptions_wheelTarget = (_inputOptions = inputOptions) == null ? void 0 : _inputOptions.wheelTarget) != null ? _inputOptions_wheelTarget : canvas);
|
|
18428
|
+
var _inputOptions_pointerTarget;
|
|
18429
|
+
this._pointerManager = new PointerManager(engine, (_inputOptions_pointerTarget = (_inputOptions1 = inputOptions) == null ? void 0 : _inputOptions1.pointerTarget) != null ? _inputOptions_pointerTarget : canvas);
|
|
18430
|
+
var _inputOptions_keyboardTarget;
|
|
18431
|
+
this._keyboardManager = new KeyboardManager(engine, (_inputOptions_keyboardTarget = (_inputOptions2 = inputOptions) == null ? void 0 : _inputOptions2.keyboardTarget) != null ? _inputOptions_keyboardTarget : window);
|
|
18467
18432
|
this._initialized = true;
|
|
18468
18433
|
}
|
|
18469
18434
|
}
|
|
@@ -18576,8 +18541,6 @@ __decorate([
|
|
|
18576
18541
|
* @internal
|
|
18577
18542
|
*/ _proto._destroy = function _destroy() {
|
|
18578
18543
|
if (this._initialized) {
|
|
18579
|
-
window.removeEventListener("blur", this._onBlur);
|
|
18580
|
-
window.removeEventListener("focus", this._onFocus);
|
|
18581
18544
|
this._wheelManager._destroy();
|
|
18582
18545
|
this._wheelManager = null;
|
|
18583
18546
|
this._pointerManager._destroy();
|
|
@@ -18586,16 +18549,6 @@ __decorate([
|
|
|
18586
18549
|
this._keyboardManager = null;
|
|
18587
18550
|
}
|
|
18588
18551
|
};
|
|
18589
|
-
_proto._onBlur = function _onBlur() {
|
|
18590
|
-
this._wheelManager._onBlur();
|
|
18591
|
-
this._pointerManager._onBlur();
|
|
18592
|
-
this._keyboardManager._onBlur();
|
|
18593
|
-
};
|
|
18594
|
-
_proto._onFocus = function _onFocus() {
|
|
18595
|
-
this._wheelManager._onFocus();
|
|
18596
|
-
this._pointerManager._onFocus();
|
|
18597
|
-
this._keyboardManager._onFocus();
|
|
18598
|
-
};
|
|
18599
18552
|
_create_class(InputManager, [
|
|
18600
18553
|
{
|
|
18601
18554
|
key: "pointers",
|
|
@@ -19093,7 +19046,7 @@ ShaderPool.init();
|
|
|
19093
19046
|
_this._spriteMaskDefaultMaterial = _this._createSpriteMaskMaterial();
|
|
19094
19047
|
_this._textDefaultFont = Font.createFromOS(_assert_this_initialized(_this), "Arial");
|
|
19095
19048
|
_this._textDefaultFont.isGCIgnored = true;
|
|
19096
|
-
_this.inputManager = new InputManager(_assert_this_initialized(_this));
|
|
19049
|
+
_this.inputManager = new InputManager(_assert_this_initialized(_this), configuration.input);
|
|
19097
19050
|
var xrDevice = configuration.xrDevice;
|
|
19098
19051
|
if (xrDevice) {
|
|
19099
19052
|
_this.xrManager = new XRManager();
|
|
@@ -21941,7 +21894,12 @@ var passNum = 0;
|
|
|
21941
21894
|
if (componentA.instanceId === componentB.instanceId) {
|
|
21942
21895
|
return dataA.material._priority - dataB.material._priority || componentA._distanceForSort - componentB._distanceForSort;
|
|
21943
21896
|
} else {
|
|
21944
|
-
|
|
21897
|
+
var distanceDiff = componentA._distanceForSort - componentB._distanceForSort;
|
|
21898
|
+
if (distanceDiff === 0) {
|
|
21899
|
+
return componentA.instanceId - componentB.instanceId;
|
|
21900
|
+
} else {
|
|
21901
|
+
return distanceDiff;
|
|
21902
|
+
}
|
|
21945
21903
|
}
|
|
21946
21904
|
};
|
|
21947
21905
|
/**
|
|
@@ -21959,7 +21917,12 @@ var passNum = 0;
|
|
|
21959
21917
|
if (componentA.instanceId === componentB.instanceId) {
|
|
21960
21918
|
return dataA.material._priority - dataB.material._priority || componentB._distanceForSort - componentA._distanceForSort;
|
|
21961
21919
|
} else {
|
|
21962
|
-
|
|
21920
|
+
var distanceDiff = componentB._distanceForSort - componentA._distanceForSort;
|
|
21921
|
+
if (distanceDiff === 0) {
|
|
21922
|
+
return componentA.instanceId - componentB.instanceId;
|
|
21923
|
+
} else {
|
|
21924
|
+
return distanceDiff;
|
|
21925
|
+
}
|
|
21963
21926
|
}
|
|
21964
21927
|
};
|
|
21965
21928
|
return RenderQueue;
|
|
@@ -23173,14 +23136,14 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23173
23136
|
/** @internal */ _this._cameraIndex = -1;
|
|
23174
23137
|
_this._priority = 0;
|
|
23175
23138
|
_this._shaderData = new ShaderData(ShaderDataGroup.Camera);
|
|
23176
|
-
_this.
|
|
23139
|
+
_this._isCustomViewMatrix = false;
|
|
23140
|
+
_this._isCustomProjectionMatrix = false;
|
|
23177
23141
|
_this._nearClipPlane = 0.1;
|
|
23178
23142
|
_this._farClipPlane = 100;
|
|
23179
23143
|
_this._fieldOfView = 45;
|
|
23180
23144
|
_this._orthographicSize = 10;
|
|
23181
23145
|
_this._isProjectionDirty = true;
|
|
23182
23146
|
_this._isInvProjMatDirty = true;
|
|
23183
|
-
_this._isFrustumProjectDirty = true;
|
|
23184
23147
|
_this._customAspectRatio = undefined;
|
|
23185
23148
|
_this._renderTarget = null;
|
|
23186
23149
|
_this._depthBufferParams = new Vector4();
|
|
@@ -23192,7 +23155,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23192
23155
|
_this._transform = transform;
|
|
23193
23156
|
_this._isViewMatrixDirty = transform.registerWorldChangeFlag();
|
|
23194
23157
|
_this._isInvViewProjDirty = transform.registerWorldChangeFlag();
|
|
23195
|
-
_this.
|
|
23158
|
+
_this._frustumChangeFlag = transform.registerWorldChangeFlag();
|
|
23196
23159
|
_this._renderPipeline = new BasicRenderPipeline(_assert_this_initialized(_this));
|
|
23197
23160
|
_this._addResourceReferCount(_this.shaderData, 1);
|
|
23198
23161
|
_this._updatePixelViewport();
|
|
@@ -23204,16 +23167,22 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23204
23167
|
}
|
|
23205
23168
|
var _proto = Camera1.prototype;
|
|
23206
23169
|
/**
|
|
23170
|
+
* Restore the view matrix to the world matrix of the entity.
|
|
23171
|
+
*/ _proto.resetViewMatrix = function resetViewMatrix() {
|
|
23172
|
+
this._isCustomViewMatrix = false;
|
|
23173
|
+
this._viewMatrixChange();
|
|
23174
|
+
};
|
|
23175
|
+
/**
|
|
23207
23176
|
* Restore the automatic calculation of projection matrix through fieldOfView, nearClipPlane and farClipPlane.
|
|
23208
23177
|
*/ _proto.resetProjectionMatrix = function resetProjectionMatrix() {
|
|
23209
|
-
this.
|
|
23210
|
-
this.
|
|
23178
|
+
this._isCustomProjectionMatrix = false;
|
|
23179
|
+
this._projectionMatrixChange();
|
|
23211
23180
|
};
|
|
23212
23181
|
/**
|
|
23213
23182
|
* Restore the automatic calculation of the aspect ratio through the viewport aspect ratio.
|
|
23214
23183
|
*/ _proto.resetAspectRatio = function resetAspectRatio() {
|
|
23215
23184
|
this._customAspectRatio = undefined;
|
|
23216
|
-
this.
|
|
23185
|
+
this._projectionMatrixChange();
|
|
23217
23186
|
};
|
|
23218
23187
|
/**
|
|
23219
23188
|
* Transform a point from world space to viewport space.
|
|
@@ -23343,10 +23312,9 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23343
23312
|
context.replacementShader = this._replacementShader;
|
|
23344
23313
|
context.replacementTag = this._replacementSubShaderTag;
|
|
23345
23314
|
// compute cull frustum.
|
|
23346
|
-
if (this.enableFrustumCulling &&
|
|
23315
|
+
if (this.enableFrustumCulling && this._frustumChangeFlag.flag) {
|
|
23347
23316
|
this._frustum.calculateFromMatrix(virtualCamera.viewProjectionMatrix);
|
|
23348
|
-
this.
|
|
23349
|
-
this._isFrustumProjectDirty = false;
|
|
23317
|
+
this._frustumChangeFlag.flag = false;
|
|
23350
23318
|
}
|
|
23351
23319
|
this._updateShaderData();
|
|
23352
23320
|
// union scene and camera macro.
|
|
@@ -23401,7 +23369,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23401
23369
|
this._renderPipeline = null;
|
|
23402
23370
|
this._virtualCamera = null;
|
|
23403
23371
|
this._shaderData = null;
|
|
23404
|
-
this.
|
|
23372
|
+
this._frustumChangeFlag = null;
|
|
23405
23373
|
this._transform = null;
|
|
23406
23374
|
this._isViewMatrixDirty = null;
|
|
23407
23375
|
this._isInvViewProjDirty = null;
|
|
@@ -23423,11 +23391,16 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23423
23391
|
var viewport = this._viewport;
|
|
23424
23392
|
this._pixelViewport.set(viewport.x * width, viewport.y * height, viewport.z * width, viewport.w * height);
|
|
23425
23393
|
};
|
|
23426
|
-
_proto.
|
|
23427
|
-
this.
|
|
23394
|
+
_proto._viewMatrixChange = function _viewMatrixChange() {
|
|
23395
|
+
this._isViewMatrixDirty.flag = true;
|
|
23396
|
+
this._isInvViewProjDirty.flag = true;
|
|
23397
|
+
this._frustumChangeFlag.flag = true;
|
|
23398
|
+
};
|
|
23399
|
+
_proto._projectionMatrixChange = function _projectionMatrixChange() {
|
|
23428
23400
|
this._isProjectionDirty = true;
|
|
23429
23401
|
this._isInvProjMatDirty = true;
|
|
23430
23402
|
this._isInvViewProjDirty.flag = true;
|
|
23403
|
+
this._frustumChangeFlag.flag = true;
|
|
23431
23404
|
};
|
|
23432
23405
|
_proto._innerViewportToWorldPoint = function _innerViewportToWorldPoint(x, y, z, invViewProjMat, out) {
|
|
23433
23406
|
// Depth is a normalized value, 0 is nearPlane, 1 is farClipPlane.
|
|
@@ -23470,7 +23443,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23470
23443
|
_proto._onPixelViewportChanged = function _onPixelViewportChanged() {
|
|
23471
23444
|
this._updatePixelViewport();
|
|
23472
23445
|
var _this__customAspectRatio;
|
|
23473
|
-
(_this__customAspectRatio = this._customAspectRatio) != null ? _this__customAspectRatio : this.
|
|
23446
|
+
(_this__customAspectRatio = this._customAspectRatio) != null ? _this__customAspectRatio : this._projectionMatrixChange();
|
|
23474
23447
|
};
|
|
23475
23448
|
_create_class(Camera1, [
|
|
23476
23449
|
{
|
|
@@ -23490,7 +23463,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23490
23463
|
},
|
|
23491
23464
|
set: function set(value) {
|
|
23492
23465
|
this._nearClipPlane = value;
|
|
23493
|
-
this.
|
|
23466
|
+
this._projectionMatrixChange();
|
|
23494
23467
|
}
|
|
23495
23468
|
},
|
|
23496
23469
|
{
|
|
@@ -23502,7 +23475,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23502
23475
|
},
|
|
23503
23476
|
set: function set(value) {
|
|
23504
23477
|
this._farClipPlane = value;
|
|
23505
|
-
this.
|
|
23478
|
+
this._projectionMatrixChange();
|
|
23506
23479
|
}
|
|
23507
23480
|
},
|
|
23508
23481
|
{
|
|
@@ -23514,7 +23487,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23514
23487
|
},
|
|
23515
23488
|
set: function set(value) {
|
|
23516
23489
|
this._fieldOfView = value;
|
|
23517
|
-
this.
|
|
23490
|
+
this._projectionMatrixChange();
|
|
23518
23491
|
}
|
|
23519
23492
|
},
|
|
23520
23493
|
{
|
|
@@ -23529,7 +23502,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23529
23502
|
},
|
|
23530
23503
|
set: function set(value) {
|
|
23531
23504
|
this._customAspectRatio = value;
|
|
23532
|
-
this.
|
|
23505
|
+
this._projectionMatrixChange();
|
|
23533
23506
|
}
|
|
23534
23507
|
},
|
|
23535
23508
|
{
|
|
@@ -23581,7 +23554,12 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23581
23554
|
},
|
|
23582
23555
|
set: function set(value) {
|
|
23583
23556
|
this._virtualCamera.isOrthographic = value;
|
|
23584
|
-
this.
|
|
23557
|
+
this._projectionMatrixChange();
|
|
23558
|
+
if (value) {
|
|
23559
|
+
this.shaderData.enableMacro("CAMERA_ORTHOGRAPHIC");
|
|
23560
|
+
} else {
|
|
23561
|
+
this.shaderData.disableMacro("CAMERA_ORTHOGRAPHIC");
|
|
23562
|
+
}
|
|
23585
23563
|
}
|
|
23586
23564
|
},
|
|
23587
23565
|
{
|
|
@@ -23593,7 +23571,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23593
23571
|
},
|
|
23594
23572
|
set: function set(value) {
|
|
23595
23573
|
this._orthographicSize = value;
|
|
23596
|
-
this.
|
|
23574
|
+
this._projectionMatrixChange();
|
|
23597
23575
|
}
|
|
23598
23576
|
},
|
|
23599
23577
|
{
|
|
@@ -23602,22 +23580,31 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23602
23580
|
* View matrix.
|
|
23603
23581
|
*/ function get() {
|
|
23604
23582
|
var viewMatrix = this._virtualCamera.viewMatrix;
|
|
23605
|
-
if (this._isViewMatrixDirty.flag) {
|
|
23606
|
-
|
|
23607
|
-
|
|
23608
|
-
|
|
23609
|
-
|
|
23610
|
-
|
|
23611
|
-
|
|
23583
|
+
if (!this._isViewMatrixDirty.flag || this._isCustomViewMatrix) {
|
|
23584
|
+
return viewMatrix;
|
|
23585
|
+
}
|
|
23586
|
+
this._isViewMatrixDirty.flag = false;
|
|
23587
|
+
// Ignore scale
|
|
23588
|
+
var transform = this._transform;
|
|
23589
|
+
Matrix.rotationTranslation(transform.worldRotationQuaternion, transform.worldPosition, viewMatrix);
|
|
23590
|
+
viewMatrix.invert();
|
|
23612
23591
|
return viewMatrix;
|
|
23592
|
+
},
|
|
23593
|
+
set: function set(value) {
|
|
23594
|
+
this._virtualCamera.viewMatrix.copyFrom(value);
|
|
23595
|
+
this._isCustomViewMatrix = true;
|
|
23596
|
+
this._viewMatrixChange();
|
|
23613
23597
|
}
|
|
23614
23598
|
},
|
|
23615
23599
|
{
|
|
23616
23600
|
key: "projectionMatrix",
|
|
23617
|
-
get:
|
|
23601
|
+
get: /**
|
|
23602
|
+
* The projection matrix is calculated by the relevant parameters of the camera by default.
|
|
23603
|
+
* If it is manually set, the manual value will be maintained. Call resetProjectionMatrix() to restore it.
|
|
23604
|
+
*/ function get() {
|
|
23618
23605
|
var virtualCamera = this._virtualCamera;
|
|
23619
23606
|
var projectionMatrix = virtualCamera.projectionMatrix;
|
|
23620
|
-
if (!this._isProjectionDirty || this.
|
|
23607
|
+
if (!this._isProjectionDirty || this._isCustomProjectionMatrix) {
|
|
23621
23608
|
return projectionMatrix;
|
|
23622
23609
|
}
|
|
23623
23610
|
this._isProjectionDirty = false;
|
|
@@ -23631,13 +23618,10 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
23631
23618
|
}
|
|
23632
23619
|
return projectionMatrix;
|
|
23633
23620
|
},
|
|
23634
|
-
set:
|
|
23635
|
-
* The projection matrix is calculated by the relevant parameters of the camera by default.
|
|
23636
|
-
* If it is manually set, the manual value will be maintained. Call resetProjectionMatrix() to restore it.
|
|
23637
|
-
*/ function set(value) {
|
|
23621
|
+
set: function set(value) {
|
|
23638
23622
|
this._virtualCamera.projectionMatrix.copyFrom(value);
|
|
23639
|
-
this.
|
|
23640
|
-
this.
|
|
23623
|
+
this._isCustomProjectionMatrix = true;
|
|
23624
|
+
this._projectionMatrixChange();
|
|
23641
23625
|
}
|
|
23642
23626
|
},
|
|
23643
23627
|
{
|
|
@@ -23698,7 +23682,7 @@ __decorate([
|
|
|
23698
23682
|
], Camera.prototype, "_cameraIndex", void 0);
|
|
23699
23683
|
__decorate([
|
|
23700
23684
|
ignoreClone
|
|
23701
|
-
], Camera.prototype, "
|
|
23685
|
+
], Camera.prototype, "_frustumChangeFlag", void 0);
|
|
23702
23686
|
__decorate([
|
|
23703
23687
|
ignoreClone
|
|
23704
23688
|
], Camera.prototype, "_transform", void 0);
|