PageSourceSearch

https://shop.forum-verlag.com/theme/f9fa94fc119aaff0ee0245340c2826…tial-cms-element.XREstimatedLight.c30f62.js

js forum-verlag.com collected 2026-09-24 10:12:12 UTC 2,602 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[96874],{874:(t,i,e)=>{e.d(i,{XREstimatedLight:()=>s});var n=e(173);class r{constructor(t,i,e,r,s){this.xrLight=t,this.renderer=i,this.lightProbe=e,this.xrWebGLBinding=null,this.estimationStartCallback=s,this.frameCallback=this.onXRFrame.bind(this);let h=i.xr.getSession();if(r&&"XRWebGLBinding"in window){let e=new n.WebGLCubeRenderTarget(16);t.environment=e.texture;let r=i.getContext();switch(h.preferredReflectionFormat){case"srgba8":r.getExtension("EXT_sRGB");break;case"rgba16f":r.getExtension("OES_texture_half_float")}this.xrWebGLBinding=new XRWebGLBinding(h,r),this.lightProbe.addEventListener("reflectionchange",()=>{this.updateReflection()})}h.requestAnimationFrame(this.frameCallback)}updateReflection(){let t=this.renderer.properties.get(this.xrLight.environment);if(t){let i=this.xrWebGLBinding.getReflectionCubeMap(this.lightProbe);i&&(t.__webglTexture=i,this.xrLight.environment.needsPMREMUpdate=!0)}}onXRFrame(t,i){if(!this.xrLight)return;i.session.requestAnimationFrame(this.frameCallback);let e=i.getLightEstimate(this.lightProbe);if(e){this.xrLight.lightProbe.sh.fromArray(e.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;let t=Math.max(1,Math.max(e.primaryLightIntensity.x,Math.max(e.primaryLightIntensity.y,e.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(e.primaryLightIntensity.x/t,e.primaryLightIntensity.y/t,e.primaryLightIntensity.z/t),this.xrLight.directionalLight.intensity=t,this.xrLight.directionalLight.position.copy(e.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}}class s extends n.Group{constructor(t,i=!0){super(),this.lightProbe=new n.LightProbe,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new n.DirectionalLight,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let e=null,s=!1;t.xr.addEventListener("sessionstart",()=>{let n=t.xr.getSession();"requestLightProbe"in n&&n.requestLightProbe({reflectionFormat:n.preferredReflectionFormat}).then(n=>{e=new r(this,t,n,i,()=>{s=!0,this.dispatchEvent({type:"estimationstart"})})})}),t.xr.addEventListener("sessionend",()=>{e&&(e.dispose(),e=null),s&&this.dispatchEvent({type:"estimationend"})}),this.dispose=()=>{e&&(e.dispose(),e=null),this.remove(this.lightProbe),this.lightProbe=null,this.remove(this.directionalLight),this.directionalLight=null,this.environment=null}}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.