PageSourceSearch

https://balloon99-kj7qgchv.manus.space/assets/directionalLight-CAC3iWIj.js

js balloon99-kj7qgchv.manus.space collected 2026-10-03 05:00:43 UTC 6,472 bytes, 1 lines download raw bytes

1import{_ as i,M as P,V as g,j as a,i as W,k as r}from"./fileTools.pure-O3hflNMy.js";import{L as Y}from"./light-KoECxAgJ.js";import{S as q}from"./shadowLight-Be7cBySd.js";import{N as J}from"./tier3-babylon-z6xMXPxH.js";import"./index-DY6XcbtQ.js";import"./smartArray-B7wVGkJ5.js";import"./tools.pure-PAKPbutq.js";import"./thinEngine-DI9LWTqR.js";import"./helperFunctions-D7-zXdUR.js";let X=(()=>{var h;let d=q,l=[],p,w,S,L=[],x=[],B,Z=[],z=[],D,M=[],R=[],T,E=[],v=[],C,b=[],A=[],U,I=[],N=[];return h=class extends d{get shadowFrustumSize(){return this._shadowFrustumSize}set shadowFrustumSize(t){this._shadowFrustumSize=t,this.forceProjectionMatrixCompute()}get shadowOrthoScale(){return this._shadowOrthoScale}set shadowOrthoScale(t){this._shadowOrthoScale=t,this.forceProjectionMatrixCompute()}get orthoLeft(){return this._orthoLeft}set orthoLeft(t){this._orthoLeft=t}get orthoRight(){return this._orthoRight}set orthoRight(t){this._orthoRight=t}get orthoTop(){return this._orthoTop}set orthoTop(t){this._orthoTop=t}get orthoBottom(){return this._orthoBottom}set orthoBottom(t){this._orthoBottom=t}constructor(t,e,n,u){super(t,n,u),this._shadowFrustumSize=(i(this,l),0),this._shadowOrthoScale=.1,this.autoUpdateExtends=i(this,L,!0),this.autoCalcShadowZBounds=(i(this,x),i(this,Z,!1)),this._orthoLeft=(i(this,z),i(this,M,Number.MAX_VALUE)),this._orthoRight=(i(this,R),i(this,E,Number.MIN_VALUE)),this._orthoTop=(i(this,v),i(this,b,Number.MIN_VALUE)),this._orthoBottom=(i(this,A),i(this,I,Number.MAX_VALUE)),i(this,N),this.position=e.scale(-1),this.direction=e}getClassName(){return"DirectionalLight"}getTypeID(){return Y.LIGHTTYPEID_DIRECTIONALLIGHT}_setDefaultShadowProjectionMatrix(t,e,n){this.shadowFrustumSize>0?this._setDefaultFixedFrustumShadowProjectionMatrix(t):this._setDefaultAutoExtendShadowProjectionMatrix(t,e,n)}_setDefaultFixedFrustumShadowProjectionMatrix(t){const e=this.getScene().activeCamera;P.OrthoLHToRef(this.shadowFrustumSize,this.shadowFrustumSize,this.shadowMinZ!==void 0?this.shadowMinZ:e?e.minZ:0,this.shadowMaxZ!==void 0?this.shadowMaxZ:e?e.maxZ:1e4,t,this.getScene().getEngine().isNDCHalfZRange)}_setDefaultAutoExtendShadowProjectionMatrix(t,e,n){const u=this.getScene().activeCamera;if(this.autoUpdateExtends||this._orthoLeft===Number.MAX_VALUE){const o=g.Zero();this._orthoLeft=Number.MAX_VALUE,this._orthoRight=-Number.MAX_VALUE,this._orthoTop=-Number.MAX_VALUE,this._orthoBottom=Number.MAX_VALUE;let f=Number.MAX_VALUE,_=-Number.MAX_VALUE;for(let c=0;c<n.length;c++){const k=n[c];if(!k)continue;const H=k.getBoundingInfo().boundingBox;for(let m=0;m<H.vectorsWorld.length;m++)g.TransformCoordinatesToRef(H.vectorsWorld[m],e,o),o.x<this._orthoLeft&&(this._orthoLeft=o.x),o.y<this._orthoBottom&&(this._orthoBottom=o.y),o.x>this._orthoRight&&(this._orthoRight=o.x),o.y>this._orthoTop&&(this._orthoTop=o.y),this.autoCalcShadowZBounds&&(o.z<f&&(f=o.z),o.z>_&&(_=o.z))}this.autoCalcShadowZBounds&&(this._shadowMinZ=f,this._shadowMaxZ=_)}const O=this._orthoRight-this._orthoLeft,F=this._orthoTop-this._orthoBottom,y=this.shadowMinZ!==void 0?this.shadowMinZ:u?.minZ||0,V=this.shadowMaxZ!==void 0?this.shadowMaxZ:u?.maxZ||1e4,j=this.getScene().getEngine().useReverseDepthBuffer;P.OrthoOffCenterLHToRef(this._orthoLeft-O*this.shadowOrthoScale,this._orthoRight+O*this.shadowOrthoScale,this._orthoBottom-F*this.shadowOrthoScale,this._orthoTop+F*this.shadowOrthoScale,j?V:y,j?y:V,t,this.getScene().getEngine().isNDCHalfZRange)}_buildUniformLayout(){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(t,e){return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z,1,e),this):(this._uniformBuffer.updateFloat4("vLightData",this.direction.x,this.direction.y,this.direction.z,1,e),this)}transferToNodeMaterialEffect(t,e){return this.computeTransformedInformation()?(t.
1setFloat3(e,this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z),this):(t.setFloat3(e,this.direction.x,this.direction.y,this.direction.z),this)}getDepthMinZ(t){const e=this._scene.getEngine();return!e.useReverseDepthBuffer&&e.isNDCHalfZRange?0:1}getDepthMaxZ(t){const e=this._scene.getEngine();return e.useReverseDepthBuffer&&e.isNDCHalfZRange?0:1}prepareLightSpecificDefines(t,e){t["DIRLIGHT"+e]=!0}},(()=>{const s=typeof Symbol=="function"&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;p=[r()],w=[r()],S=[r()],B=[r()],D=[r("orthoLeft")],T=[r("orthoRight")],C=[r("orthoTop")],U=[r("orthoBottom")],a(h,null,p,{kind:"getter",name:"shadowFrustumSize",static:!1,private:!1,access:{has:t=>"shadowFrustumSize"in t,get:t=>t.shadowFrustumSize},metadata:s},null,l),a(h,null,w,{kind:"getter",name:"shadowOrthoScale",static:!1,private:!1,access:{has:t=>"shadowOrthoScale"in t,get:t=>t.shadowOrthoScale},metadata:s},null,l),a(null,null,S,{kind:"field",name:"autoUpdateExtends",static:!1,private:!1,access:{has:t=>"autoUpdateExtends"in t,get:t=>t.autoUpdateExtends,set:(t,e)=>{t.autoUpdateExtends=e}},metadata:s},L,x),a(null,null,B,{kind:"field",name:"autoCalcShadowZBounds",static:!1,private:!1,access:{has:t=>"autoCalcShadowZBounds"in t,get:t=>t.autoCalcShadowZBounds,set:(t,e)=>{t.autoCalcShadowZBounds=e}},metadata:s},Z,z),a(null,null,D,{kind:"field",name:"_orthoLeft",static:!1,private:!1,access:{has:t=>"_orthoLeft"in t,get:t=>t._orthoLeft,set:(t,e)=>{t._orthoLeft=e}},metadata:s},M,R),a(null,null,T,{kind:"field",name:"_orthoRight",static:!1,private:!1,access:{has:t=>"_orthoRight"in t,get:t=>t._orthoRight,set:(t,e)=>{t._orthoRight=e}},metadata:s},E,v),a(null,null,C,{kind:"field",name:"_orthoTop",static:!1,private:!1,access:{has:t=>"_orthoTop"in t,get:t=>t._orthoTop,set:(t,e)=>{t._orthoTop=e}},metadata:s},b,A),a(null,null,U,{kind:"field",name:"_orthoBottom",static:!1,private:!1,access:{has:t=>"_orthoBottom"in t,get:t=>t._orthoBottom,set:(t,e)=>{t._orthoBottom=e}},metadata:s},I,N),s&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),h})(),G=!1;function K(){G||(G=!0,J.AddNodeConstructor("Light_Type_1",(h,d)=>()=>new X(h,g.Zero(),d)),W("BABYLON.DirectionalLight",X))}K();export{X as DirectionalLight,K as RegisterDirectionalLight};

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.