MCPcopy
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / je

Function je

assets/js/space-wrap.js:160–209  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

158for(var a=0;a<k.length;a++)k[a].userData.inputSource=t[a]}))};this.getCamera=function(a){if(b()){var c=a.parent,d=n.cameras;e(n,c);for(var f=0;f<d.length;f++)e(d[f],c);a.matrixWorld.copy(n.matrixWorld);a=a.children;f=0;for(c=a.length;f<c;f++)a[f].updateMatrixWorld(!0);uf(n,r,u);return n}return a};this.isPresenting=b;var z=null,x=new de;x.setAnimationLoop(function(a,b){p=b.getDevicePose(m);if(null!==p)for(var c=h.baseLayer,d=b.views,e=0;e<d.length;e++){var f=d[e],g=c.getViewport(f),l=p.getViewMatrix(f),
159q=n.cameras[e];q.matrix.fromArray(l).getInverse(q.matrix);q.projectionMatrix.fromArray(f.projectionMatrix);q.viewport.set(g.x,g.y,g.width,g.height);0===e&&n.matrix.copy(q.matrix)}for(e=0;e<k.length;e++){c=k[e];if(d=t[e])if(d=b.getInputPose(d,m),null!==d){"targetRay"in d?c.matrix.elements=d.targetRay.transformMatrix:"pointerMatrix"in d&&(c.matrix.elements=d.pointerMatrix);c.matrix.decompose(c.position,c.rotation,c.scale);c.visible=!0;continue}c.visible=!1}z&&z(a)});this.setAnimationLoop=function(a){z=
160a};this.dispose=function(){};this.getStandingMatrix=function(){console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed.");return new P};this.submitFrame=function(){}}function je(a){var b;function c(){ja=new hg(N);Aa=new fg(N,ja,a);Aa.isWebGL2||(ja.get("WEBGL_depth_texture"),ja.get("OES_texture_float"),ja.get("OES_texture_half_float"),ja.get("OES_texture_half_float_linear"),ja.get("OES_standard_derivatives"),ja.get("OES_element_index_uint"),ja.get("ANGLE_instanced_arrays"));ja.get("OES_texture_float_linear");
161ea=new tf(N,ja,Aa);aa=new eh(N,ja,ea,Aa);aa.scissor(Y.copy(Z).multiplyScalar(X));aa.viewport(U.copy(L).multiplyScalar(X));mb=new kg(N);Ba=new Xg;ba=new fh(N,ja,aa,Ba,Aa,ea,mb);qa=new Zf(N);sa=new ig(N,qa,mb);ka=new ng(sa,mb);va=new mg(N);da=new Wg(A,ja,Aa,ba);ra=new $g;oa=new dh;ia=new dg(A,aa,ka,ua);xa=new eg(N,ja,mb,Aa);ya=new jg(N,ja,mb,Aa);mb.programs=da.programs;A.context=N;A.capabilities=Aa;A.extensions=ja;A.properties=Ba;A.renderLists=ra;A.state=aa;A.info=mb}function d(a){a.preventDefault();
162console.log("THREE.WebGLRenderer: Context Lost.");M=!0}function e(){console.log("THREE.WebGLRenderer: Context Restored.");M=!1;c()}function f(a){a=a.target;a.removeEventListener("dispose",f);g(a);Ba.remove(a)}function g(a){var b=Ba.get(a).program;a.program=void 0;void 0!==b&&da.releaseProgram(b)}function h(a,b){a.render(function(a){A.renderBufferImmediate(a,b)})}function l(a,b,c,d){if(!1!==a.visible){if(a.layers.test(b.layers))if(a.isGroup)c=a.renderOrder;else if(a.isLight)B.pushLight(a),a.castShadow&&
163B.pushShadow(a);else if(a.isSprite){if(!a.frustumCulled||ma.intersectsSprite(a)){d&&lb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(Ic);var e=ka.update(a),f=a.material;f.visible&&D.push(a,e,f,c,lb.z,null)}}else if(a.isImmediateRenderObject)d&&lb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(Ic),D.push(a,null,a.material,c,lb.z,null);else if(a.isMesh||a.isLine||a.isPoints)if(a.isSkinnedMesh&&a.skeleton.update(),!a.frustumCulled||ma.intersectsObject(a))if(d&&lb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(Ic),
164e=ka.update(a),f=a.material,Array.isArray(f))for(var g=e.groups,h=0,m=g.length;h<m;h++){var q=g[h],p=f[q.materialIndex];p&&p.visible&&D.push(a,e,p,c,lb.z,q)}else f.visible&&D.push(a,e,f,c,lb.z,null);a=a.children;h=0;for(m=a.length;h<m;h++)l(a[h],b,c,d)}}function m(a,b,c,d){for(var e=0,f=a.length;e<f;e++){var g=a[e],h=g.object,l=g.geometry,m=void 0===d?g.material:d;g=g.group;if(c.isArrayCamera){R=c;for(var p=c.cameras,k=0,v=p.length;k<v;k++){var r=p[k];if(h.layers.test(r.layers)){if("viewport"in r)aa.viewport(U.copy(r.viewport));
165else{var t=r.bounds;aa.viewport(U.set(t.x*T,t.y*Wa,t.z*T,t.w*Wa).multiplyScalar(X))}B.setupLights(r);q(h,b,r,l,m,g)}}}else R=null,q(h,b,c,l,m,g)}}function q(a,c,d,e,f,g){a.onBeforeRender(A,c,d,e,f,g);B=oa.get(c,R||d);a.modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,a.matrixWorld);a.normalMatrix.getNormalMatrix(a.modelViewMatrix);if(a.isImmediateRenderObject){aa.setMaterial(f);var l=k(d,c.fog,f,a);H=b=null;xb=!1;h(a,l)}else A.renderBufferDirect(d,c.fog,e,f,a,g);a.onAfterRender(A,c,d,e,f,g);
166B=oa.get(c,R||d)}function p(a,b,c){var d=Ba.get(a),e=B.state.lights,h=d.lightsHash,l=e.state.hash;c=da.getParameters(a,e.state,B.state.shadowsArray,b,Ha.numPlanes,Ha.numIntersection,c);var m=da.getProgramCode(a,c),q=d.program,p=!0;if(void 0===q)a.addEventListener("dispose",f);else if(q.code!==m)g(a);else{if(h.stateID!==l.stateID||h.directionalLength!==l.directionalLength||h.pointLength!==l.pointLength||h.spotLength!==l.spotLength||h.rectAreaLength!==l.rectAreaLength||h.hemiLength!==l.hemiLength||
167h.shadowsLength!==l.shadowsLength)h.stateID=l.stateID,h.directionalLength=l.directionalLength,h.pointLength=l.pointLength,h.spotLength=l.spotLength,h.rectAreaLength=l.rectAreaLength,h.hemiLength=l.hemiLength,h.shadowsLength=l.shadowsLength;else if(void 0!==c.shaderID)return;p=!1}p&&(c.shaderID?(m=Va[c.shaderID],d.shader={name:a.type,uniforms:Rb(m.uniforms),vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}):d.shader={name:a.type,uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader},
168a.onBeforeCompile(d.shader,A),m=da.getProgramCode(a,c),q=da.acquireProgram(a,d.shader,c,m),d.program=q,a.program=q);c=q.getAttributes();if(a.morphTargets)for(m=a.numSupportedMorphTargets=0;m<A.maxMorphTargets;m++)0<=c["morphTarget"+m]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(m=a.numSupportedMorphNormals=0;m<A.maxMorphNormals;m++)0<=c["morphNormal"+m]&&a.numSupportedMorphNormals++;c=d.shader.uniforms;if(!a.isShaderMaterial&&!a.isRawShaderMaterial||!0===a.clipping)d.numClippingPlanes=Ha.numPlanes,
169d.numIntersection=Ha.numIntersection,c.clippingPlanes=Ha.uniform;d.fog=b;void 0===h&&(d.lightsHash=h={});h.stateID=l.stateID;h.directionalLength=l.directionalLength;h.pointLength=l.pointLength;h.spotLength=l.spotLength;h.rectAreaLength=l.rectAreaLength;h.hemiLength=l.hemiLength;h.shadowsLength=l.shadowsLength;a.lights&&(c.ambientLightColor.value=e.state.ambient,c.lightProbe.value=e.state.probe,c.directionalLights.value=e.state.directional,c.spotLights.value=e.state.spot,c.rectAreaLights.value=e.state.rectArea,
170c.pointLights.value=e.state.point,c.hemisphereLights.value=e.state.hemi,c.directionalShadowMap.value=e.state.directionalShadowMap,c.directionalShadowMatrix.value=e.state.directionalShadowMatrix,c.spotShadowMap.value=e.state.spotShadowMap,c.spotShadowMatrix.value=e.state.spotShadowMatrix,c.pointShadowMap.value=e.state.pointShadowMap,c.pointShadowMatrix.value=e.state.pointShadowMatrix);a=d.program.getUniforms();a=ib.seqWithValue(a.seq,c);d.uniformsList=a}function k(a,b,c,d){ba.resetTextureUnits();var e=
171Ba.get(c),f=e.lightsHash,g=B.state.lights.state.hash;na&&(fa||a!==bb)&&Ha.setState(c.clippingPlanes,c.clipIntersection,c.clipShadows,a,e,a===bb&&c.id===S);!1===c.needsUpdate&&(void 0===e.program?c.needsUpdate=!0:c.fog&&e.fog!==b?c.needsUpdate=!0:!c.lights||f.stateID===g.stateID&&f.directionalLength===g.directionalLength&&f.pointLength===g.pointLength&&f.spotLength===g.spotLength&&f.rectAreaLength===g.rectAreaLength&&f.hemiLength===g.hemiLength&&f.shadowsLength===g.shadowsLength?void 0===e.numClippingPlanes||
172e.numClippingPlanes===Ha.numPlanes&&e.numIntersection===Ha.numIntersection||(c.needsUpdate=!0):c.needsUpdate=!0);c.needsUpdate&&(p(c,b,d),c.needsUpdate=!1);var h=!1,l=!1,m=!1;f=e.program;g=f.getUniforms();var q=e.shader.uniforms;aa.useProgram(f.program)&&(m=l=h=!0);c.id!==S&&(S=c.id,l=!0);if(h||bb!==a){g.setValue(N,"projectionMatrix",a.projectionMatrix);Aa.logarithmicDepthBuffer&&g.setValue(N,"logDepthBufFC",2/(Math.log(a.far+1)/Math.LN2));bb!==a&&(bb=a,m=l=!0);if(c.isShaderMaterial||c.isMeshPhongMaterial||
173c.isMeshStandardMaterial||c.envMap)h=g.map.cameraPosition,void 0!==h&&h.setValue(N,lb.setFromMatrixPosition(a.matrixWorld));(c.isMeshPhongMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial||c.skinning)&&g.setValue(N,"viewMatrix",a.matrixWorldInverse)}if(c.skinning&&(g.setOptional(N,d,"bindMatrix"),g.setOptional(N,d,"bindMatrixInverse"),a=d.skeleton))if(h=a.bones,Aa.floatVertexTextures){if(void 0===a.boneTexture){h=Math.sqrt(4*h.length);h=O.ceilPowerOfTwo(h);
174h=Math.max(h,4);var k=new Float32Array(h*h*4);k.set(a.boneMatrices);var v=new sb(k,h,h,1023,1015);v.needsUpdate=!0;a.boneMatrices=k;a.boneTexture=v;a.boneTextureSize=h}g.setValue(N,"boneTexture",a.boneTexture,ba);g.setValue(N,"boneTextureSize",a.boneTextureSize)}else g.setOptional(N,a,"boneMatrices");l&&(g.setValue(N,"toneMappingExposure",A.toneMappingExposure),g.setValue(N,"toneMappingWhitePoint",A.toneMappingWhitePoint),c.lights&&(l=m,q.ambientLightColor.needsUpdate=l,q.lightProbe.needsUpdate=l,
175q.directionalLights.needsUpdate=l,q.pointLights.needsUpdate=l,q.spotLights.needsUpdate=l,q.rectAreaLights.needsUpdate=l,q.hemisphereLights.needsUpdate=l),b&&c.fog&&(q.fogColor.value.copy(b.color),b.isFog?(q.fogNear.value=b.near,q.fogFar.value=b.far):b.isFogExp2&&(q.fogDensity.value=b.density)),c.isMeshBasicMaterial?t(q,c):c.isMeshLambertMaterial?(t(q,c),c.emissiveMap&&(q.emissiveMap.value=c.emissiveMap)):c.isMeshPhongMaterial?(t(q,c),c.isMeshToonMaterial?(r(q,c),c.gradientMap&&(q.gradientMap.value=
176c.gradientMap)):r(q,c)):c.isMeshStandardMaterial?(t(q,c),c.isMeshPhysicalMaterial?(u(q,c),q.reflectivity.value=c.reflectivity,q.clearCoat.value=c.clearCoat,q.clearCoatRoughness.value=c.clearCoatRoughness):u(q,c)):c.isMeshMatcapMaterial?(t(q,c),c.matcap&&(q.matcap.value=c.matcap),c.bumpMap&&(q.bumpMap.value=c.bumpMap,q.bumpScale.value=c.bumpScale,1===c.side&&(q.bumpScale.value*=-1)),c.normalMap&&(q.normalMap.value=c.normalMap,q.normalScale.value.copy(c.normalScale),1===c.side&&q.normalScale.value.negate()),
177c.displacementMap&&(q.displacementMap.value=c.displacementMap,q.displacementScale.value=c.displacementScale,q.displacementBias.value=c.displacementBias)):c.isMeshDepthMaterial?(t(q,c),c.displacementMap&&(q.displacementMap.value=c.displacementMap,q.displacementScale.value=c.displacementScale,q.displacementBias.value=c.displacementBias)):c.isMeshDistanceMaterial?(t(q,c),c.displacementMap&&(q.displacementMap.value=c.displacementMap,q.displacementScale.value=c.displacementScale,q.displacementBias.value=
178c.displacementBias),q.referencePosition.value.copy(c.referencePosition),q.nearDistance.value=c.nearDistance,q.farDistance.value=c.farDistance):c.isMeshNormalMaterial?(t(q,c),c.bumpMap&&(q.bumpMap.value=c.bumpMap,q.bumpScale.value=c.bumpScale,1===c.side&&(q.bumpScale.value*=-1)),c.normalMap&&(q.normalMap.value=c.normalMap,q.normalScale.value.copy(c.normalScale),1===c.side&&q.normalScale.value.negate()),c.displacementMap&&(q.displacementMap.value=c.displacementMap,q.displacementScale.value=c.displacementScale,
179q.displacementBias.value=c.displacementBias)):c.isLineBasicMaterial?(q.diffuse.value.copy(c.color),q.opacity.value=c.opacity,c.isLineDashedMaterial&&(q.dashSize.value=c.dashSize,q.totalSize.value=c.dashSize+c.gapSize,q.scale.value=c.scale)):c.isPointsMaterial?(q.diffuse.value.copy(c.color),q.opacity.value=c.opacity,q.size.value=c.size*X,q.scale.value=.5*Wa,q.map.value=c.map,null!==c.map&&(!0===c.map.matrixAutoUpdate&&c.map.updateMatrix(),q.uvTransform.value.copy(c.map.matrix))):c.isSpriteMaterial?
180(q.diffuse.value.copy(c.color),q.opacity.value=c.opacity,q.rotation.value=c.rotation,q.map.value=c.map,null!==c.map&&(!0===c.map.matrixAutoUpdate&&c.map.updateMatrix(),q.uvTransform.value.copy(c.map.matrix))):c.isShadowMaterial&&(q.color.value.copy(c.color),q.opacity.value=c.opacity),void 0!==q.ltc_1&&(q.ltc_1.value=J.LTC_1),void 0!==q.ltc_2&&(q.ltc_2.value=J.LTC_2),ib.upload(N,e.uniformsList,q,ba));c.isShaderMaterial&&!0===c.uniformsNeedUpdate&&(ib.upload(N,e.uniformsList,q,ba),c.uniformsNeedUpdate=
181!1);c.isSpriteMaterial&&g.setValue(N,"center",d.center);g.setValue(N,"modelViewMatrix",d.modelViewMatrix);g.setValue(N,"normalMatrix",d.normalMatrix);g.setValue(N,"modelMatrix",d.matrixWorld);return f}function t(a,b){a.opacity.value=b.opacity;b.color&&a.diffuse.value.copy(b.color);b.emissive&&a.emissive.value.copy(b.emissive).multiplyScalar(b.emissiveIntensity);b.map&&(a.map.value=b.map);b.alphaMap&&(a.alphaMap.value=b.alphaMap);b.specularMap&&(a.specularMap.value=b.specularMap);b.envMap&&(a.envMap.value=
182b.envMap,a.flipEnvMap.value=b.envMap.isCubeTexture?-1:1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.maxMipLevel.value=Ba.get(b.envMap).__maxMipLevel);b.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=b.lightMapIntensity);b.aoMap&&(a.aoMap.value=b.aoMap,a.aoMapIntensity.value=b.aoMapIntensity);if(b.map)var c=b.map;else b.specularMap?c=b.specularMap:b.displacementMap?c=b.displacementMap:b.normalMap?c=b.normalMap:b.bumpMap?c=b.bumpMap:b.roughnessMap?
183c=b.roughnessMap:b.metalnessMap?c=b.metalnessMap:b.alphaMap?c=b.alphaMap:b.emissiveMap&&(c=b.emissiveMap);void 0!==c&&(c.isWebGLRenderTarget&&(c=c.texture),!0===c.matrixAutoUpdate&&c.updateMatrix(),a.uvTransform.value.copy(c.matrix))}function r(a,b){a.specular.value.copy(b.specular);a.shininess.value=Math.max(b.shininess,1E-4);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=
184b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias)}function u(a,b){a.roughness.value=b.roughness;a.metalness.value=b.metalness;b.roughnessMap&&(a.roughnessMap.value=b.roughnessMap);b.metalnessMap&&(a.metalnessMap.value=b.metalnessMap);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=
185b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);b.envMap&&(a.envMapIntensity.value=b.envMapIntensity)}console.log("THREE.WebGLRenderer","104");a=a||{};var w=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml",
186"canvas"),z=void 0!==a.context?a.context:null,x=void 0!==a.alpha?a.alpha:!1,y=void 0!==a.depth?a.depth:!0,F=void 0!==a.stencil?a.stencil:!0,G=void 0!==a.antialias?a.antialias:!1,ua=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,E=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,I=void 0!==a.powerPreference?a.powerPreference:"default",D=null,B=null;this.domElement=w;this.context=null;this.debug={checkShaderErrors:!1};this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=
187this.autoClear=!0;this.clippingPlanes=[];this.localClippingEnabled=!1;this.gammaFactor=2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var A=this,M=!1,K=null,Q=null,ha=null,S=-1;var H=b=null;var xb=!1;var bb=null,R=null,U=new W,Y=new W,V=null,T=w.width,Wa=w.height,X=1,L=new W(0,0,T,Wa),Z=new W(0,0,T,Wa),ca=!1,ma=new yd,Ha=new gg,na=!1,fa=!1,Ic=new P,lb=new n;try{x=
188{alpha:x,depth:y,stencil:F,antialias:G,premultipliedAlpha:ua,preserveDrawingBuffer:E,powerPreference:I};w.addEventListener("webglcontextlost",d,!1);w.addEventListener("webglcontextrestored",e,!1);var N=z||w.getContext("webgl",x)||w.getContext("experimental-webgl",x);if(null===N){if(null!==w.getContext("webgl"))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===N.getShaderPrecisionFormat&&(N.getShaderPrecisionFormat=function(){return{rangeMin:1,
189rangeMax:1,precision:1}})}catch(yf){throw console.error("THREE.WebGLRenderer: "+yf.message),yf;}var ja,Aa,aa,mb,Ba,ba,qa,sa,ka,da,ra,oa,ia,va,xa,ya,ea;c();var la="undefined"!==typeof navigator&&"xr"in navigator?new gh(A):new xf(A);this.vr=la;var za=new rf(A,ka,Aa.maxTextureSize);this.shadowMap=za;this.getContext=function(){return N};this.getContextAttributes=function(){return N.getContextAttributes()};this.forceContextLoss=function(){var a=ja.get("WEBGL_lose_context");a&&a.loseContext()};this.forceContextRestore=
190function(){var a=ja.get("WEBGL_lose_context");a&&a.restoreContext()};this.getPixelRatio=function(){return X};this.setPixelRatio=function(a){void 0!==a&&(X=a,this.setSize(T,Wa,!1))};this.getSize=function(a){void 0===a&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),a=new C);return a.set(T,Wa)};this.setSize=function(a,b,c){la.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(T=a,Wa=b,w.width=a*X,w.height=b*X,!1!==
191c&&(w.style.width=a+"px",w.style.height=b+"px"),this.setViewport(0,0,a,b))};this.getDrawingBufferSize=function(a){void 0===a&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),a=new C);return a.set(T*X,Wa*X)};this.setDrawingBufferSize=function(a,b,c){T=a;Wa=b;X=c;w.width=a*c;w.height=b*c;this.setViewport(0,0,a,b)};this.getCurrentViewport=function(a){void 0===a&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),a=
192new W);return a.copy(U)};this.getViewport=function(a){return a.copy(L)};this.setViewport=function(a,b,c,d){a.isVector4?L.set(a.x,a.y,a.z,a.w):L.set(a,b,c,d);aa.viewport(U.copy(L).multiplyScalar(X))};this.getScissor=function(a){return a.copy(Z)};this.setScissor=function(a,b,c,d){a.isVector4?Z.set(a.x,a.y,a.z,a.w):Z.set(a,b,c,d);aa.scissor(Y.copy(Z).multiplyScalar(X))};this.getScissorTest=function(){return ca};this.setScissorTest=function(a){aa.setScissorTest(ca=a)};this.getClearColor=function(){return ia.getClearColor()};
193this.setClearColor=function(){ia.setClearColor.apply(ia,arguments)};this.getClearAlpha=function(){return ia.getClearAlpha()};this.setClearAlpha=function(){ia.setClearAlpha.apply(ia,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=16384;if(void 0===b||b)d|=256;if(void 0===c||c)d|=1024;N.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.dispose=function(){w.removeEventListener("webglcontextlost",
194d,!1);w.removeEventListener("webglcontextrestored",e,!1);ra.dispose();oa.dispose();Ba.dispose();ka.dispose();la.dispose();ta.stop()};this.renderBufferImmediate=function(a,b){aa.initAttributes();var c=Ba.get(a);a.hasPositions&&!c.position&&(c.position=N.createBuffer());a.hasNormals&&!c.normal&&(c.normal=N.createBuffer());a.hasUvs&&!c.uv&&(c.uv=N.createBuffer());a.hasColors&&!c.color&&(c.color=N.createBuffer());b=b.getAttributes();a.hasPositions&&(N.bindBuffer(34962,c.position),N.bufferData(34962,a.positionArray,
19535048),aa.enableAttribute(b.position),N.vertexAttribPointer(b.position,3,5126,!1,0,0));a.hasNormals&&(N.bindBuffer(34962,c.normal),N.bufferData(34962,a.normalArray,35048),aa.enableAttribute(b.normal),N.vertexAttribPointer(b.normal,3,5126,!1,0,0));a.hasUvs&&(N.bindBuffer(34962,c.uv),N.bufferData(34962,a.uvArray,35048),aa.enableAttribute(b.uv),N.vertexAttribPointer(b.uv,2,5126,!1,0,0));a.hasColors&&(N.bindBuffer(34962,c.color),N.bufferData(34962,a.colorArray,35048),aa.enableAttribute(b.color),N.vertexAttribPointer(b.color,
1963,5126,!1,0,0));aa.disableUnusedAttributes();N.drawArrays(4,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f,g){var h=f.isMesh&&0>f.matrixWorld.determinant();aa.setMaterial(e,h);var l=k(a,c,e,f),m=!1;if(b!==d.id||H!==l.id||xb!==(!0===e.wireframe))b=d.id,H=l.id,xb=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(va.update(f,d,e,l),m=!0);h=d.index;var q=d.attributes.position;c=1;!0===e.wireframe&&(h=sa.getWireframeAttribute(d),c=2);a=xa;if(null!==h){var p=qa.get(h);a=ya;a.setIndex(p)}if(m){if(d&&
197d.isInstancedBufferGeometry&&!Aa.isWebGL2&&null===ja.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{aa.initAttributes();m=d.attributes;l=l.getAttributes();var v=e.defaultAttributeValues;for(F in l){var r=l[F];if(0<=r){var t=m[F];if(void 0!==t){var n=t.normalized,u=t.itemSize,w=qa.get(t);if(void 0!==w){var x=w.buffer,y=w.type;w=w.bytesPerElement;if(t.isInterleavedBufferAttribute){var z=
198t.data,G=z.stride;t=t.offset;z&&z.isInstancedInterleavedBuffer?(aa.enableAttributeAndDivisor(r,z.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=z.meshPerAttribute*z.count)):aa.enableAttribute(r);N.bindBuffer(34962,x);N.vertexAttribPointer(r,u,y,n,G*w,t*w)}else t.isInstancedBufferAttribute?(aa.enableAttributeAndDivisor(r,t.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):aa.enableAttribute(r),N.bindBuffer(34962,x),N.vertexAttribPointer(r,
199u,y,n,0,0)}}else if(void 0!==v&&(n=v[F],void 0!==n))switch(n.length){case 2:N.vertexAttrib2fv(r,n);break;case 3:N.vertexAttrib3fv(r,n);break;case 4:N.vertexAttrib4fv(r,n);break;default:N.vertexAttrib1fv(r,n)}}}aa.disableUnusedAttributes()}null!==h&&N.bindBuffer(34963,p.buffer)}p=Infinity;null!==h?p=h.count:void 0!==q&&(p=q.count);h=d.drawRange.start*c;q=null!==g?g.start*c:0;var F=Math.max(h,q);g=Math.max(0,Math.min(p,h+d.drawRange.count*c,q+(null!==g?g.count*c:Infinity))-1-F+1);if(0!==g){if(f.isMesh)if(!0===
200e.wireframe)aa.setLineWidth(e.wireframeLinewidth*(null===Q?X:1)),a.setMode(1);else switch(f.drawMode){case 0:a.setMode(4);break;case 1:a.setMode(5);break;case 2:a.setMode(6)}else f.isLine?(e=e.linewidth,void 0===e&&(e=1),aa.setLineWidth(e*(null===Q?X:1)),f.isLineSegments?a.setMode(1):f.isLineLoop?a.setMode(2):a.setMode(3)):f.isPoints?a.setMode(0):f.isSprite&&a.setMode(4);d&&d.isInstancedBufferGeometry?0<d.maxInstancedCount&&a.renderInstances(d,F,g):a.render(F,g)}};this.compile=function(a,b){B=oa.get(a,
201b);B.init();a.traverse(function(a){a.isLight&&(B.pushLight(a),a.castShadow&&B.pushShadow(a))});B.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=0;c<b.material.length;c++)p(b.material[c],a.fog,b);else p(b.material,a.fog,b)})};var wa=null,ta=new de;ta.setAnimationLoop(function(a){la.isPresenting()||wa&&wa(a)});"undefined"!==typeof window&&ta.setContext(window);this.setAnimationLoop=function(a){wa=a;la.setAnimationLoop(a);ta.start()};this.render=function(a,
202c,d,e){if(void 0!==d){console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.");var f=d}if(void 0!==e){console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead.");var g=e}c&&c.isCamera?M||(H=b=null,xb=!1,S=-1,bb=null,!0===a.autoUpdate&&a.updateMatrixWorld(),null===c.parent&&c.updateMatrixWorld(),la.enabled&&(c=la.getCamera(c)),B=oa.get(a,c),B.init(),a.onBeforeRender(A,a,c,f||Q),Ic.multiplyMatrices(c.projectionMatrix,
203c.matrixWorldInverse),ma.setFromMatrix(Ic),fa=this.localClippingEnabled,na=Ha.init(this.clippingPlanes,fa,c),D=ra.get(a,c),D.init(),l(a,c,0,A.sortObjects),!0===A.sortObjects&&D.sort(),na&&Ha.beginShadows(),za.render(B.state.shadowsArray,a,c),B.setupLights(c),na&&Ha.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==f&&this.setRenderTarget(f),ia.render(D,a,c,g),d=D.opaque,e=D.transparent,a.overrideMaterial?(f=a.overrideMaterial,d.length&&m(d,a,c,f),e.length&&m(e,a,c,f)):(d.length&&m(d,a,
204c),e.length&&m(e,a,c)),a.onAfterRender(A,a,c),null!==Q&&(ba.updateRenderTargetMipmap(Q),ba.updateMultisampleRenderTarget(Q)),aa.buffers.depth.setTest(!0),aa.buffers.depth.setMask(!0),aa.buffers.color.setMask(!0),aa.setPolygonOffset(!1),la.enabled&&la.submitFrame(),B=D=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")};this.setFramebuffer=function(a){K=a};this.getRenderTarget=function(){return Q};this.setRenderTarget=function(a,b,c){(Q=a)&&void 0===Ba.get(a).__webglFramebuffer&&
205ba.setupRenderTarget(a);var d=K,e=!1;a?(d=Ba.get(a).__webglFramebuffer,a.isWebGLRenderTargetCube?(d=d[b||0],e=!0):d=a.isWebGLMultisampleRenderTarget?Ba.get(a).__webglMultisampledFramebuffer:d,U.copy(a.viewport),Y.copy(a.scissor),V=a.scissorTest):(U.copy(L).multiplyScalar(X),Y.copy(Z).multiplyScalar(X),V=ca);ha!==d&&(N.bindFramebuffer(36160,d),ha=d);aa.viewport(U);aa.scissor(Y);aa.setScissorTest(V);e&&(a=Ba.get(a.texture),N.framebufferTexture2D(36160,36064,34069+(b||0),a.__webglTexture,c||0))};this.readRenderTargetPixels=
206function(a,b,c,d,e,f){if(a&&a.isWebGLRenderTarget){var g=Ba.get(a).__webglFramebuffer;if(g){var h=!1;g!==ha&&(N.bindFramebuffer(36160,g),h=!0);try{var l=a.texture,m=l.format,q=l.type;1023!==m&&ea.convert(m)!==N.getParameter(35739)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===q||ea.convert(q)===N.getParameter(35738)||1015===q&&(Aa.isWebGL2||ja.get("OES_texture_float")||ja.get("WEBGL_color_buffer_float"))||1016===q&&
207(Aa.isWebGL2?ja.get("EXT_color_buffer_float"):ja.get("EXT_color_buffer_half_float"))?36053===N.checkFramebufferStatus(36160)?0<=b&&b<=a.width-d&&0<=c&&c<=a.height-e&&N.readPixels(b,c,d,e,ea.convert(m),ea.convert(q),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&N.bindFramebuffer(36160,
208ha)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")};this.copyFramebufferToTexture=function(a,b,c){var d=b.image.width,e=b.image.height,f=ea.convert(b.format);ba.setTexture2D(b,0);N.copyTexImage2D(3553,c||0,f,a.x,a.y,d,e,0)};this.copyTextureToTexture=function(a,b,c,d){var e=b.image.width,f=b.image.height,g=ea.convert(c.format),h=ea.convert(c.type);ba.setTexture2D(c,0);b.isDataTexture?N.texSubImage2D(3553,d||0,a.x,a.y,e,f,g,h,b.image.data):
209N.texSubImage2D(3553,d||0,a.x,a.y,g,h,b.image)}}function Ad(a,b){this.name="";this.color=new A(a);this.density=void 0!==b?b:2.5E-4}function Bd(a,b,c){this.name="";this.color=new A(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3}function Cd(){D.call(this);this.type="Scene";this.overrideMaterial=this.fog=this.background=null;this.autoUpdate=!0}function Ab(a,b){this.array=a;this.stride=b;this.count=void 0!==a?a.length/b:0;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function Kc(a,
210b,c,d){this.data=a;this.itemSize=b;this.offset=c;this.normalized=!0===d}function nb(a){Q.call(this);this.type="SpriteMaterial";this.color=new A(16777215);this.map=null;this.rotation=0;this.sizeAttenuation=!0;this.lights=!1;this.transparent=!0;this.setValues(a)}function Lc(a){D.call(this);this.type="Sprite";if(void 0===Yb){Yb=new B;var b=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]);b=new Ab(b,5);Yb.setIndex([0,1,2,0,2,3]);Yb.addAttribute("position",new Kc(b,3,0,!1));Yb.addAttribute("uv",
211new Kc(b,2,3,!1))}this.geometry=Yb;this.material=void 0!==a?a:new nb;this.center=new C(.5,.5)}function Mc(){D.call(this);this.type="LOD";Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Nc(a,b){a&&a.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");qa.call(this,a,b);this.type="SkinnedMesh";this.bindMode="attached";this.bindMatrix=new P;this.bindMatrixInverse=new P}function Dd(a,b){a=a||[];this.bones=a.slice(0);
212this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[],a=0,b=this.bones.length;a<b;a++)this.boneInverses.push(new P)}function ke(){D.call(this);this.type="Bone"}function U(a){Q.call(this);this.type="LineBasicMaterial";this.color=new A(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.lights=

Callers

nothing calls this directly

Calls 11

renderMethod · 0.80
initMethod · 0.80
startMethod · 0.80
cFunction · 0.70
kFunction · 0.70
pFunction · 0.70
waFunction · 0.70
lFunction · 0.70
mFunction · 0.70
updateMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected