@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
3 lines (2 loc) • 1.05 kB
JavaScript
import{b5 as e,b6 as i,b9 as n,b7 as t,b8 as s}from"./index-DFZFpUG-.esm.min.js";function o(o,r,a,c,p=1){const u=e(),{wm:l,onDirty:d,lvs:f}=i(()=>n(g.direction.x,g.direction.y,g.direction.z,g.position.x,g.position.y,g.position.z,u));let y=a,b=Math.cos(.5*a);const g=t({lightType:"spot",children:[],position:new s(o[0],o[1],o[2],d),direction:new s(r[0],r[1],r[2],d),angle:0,exponent:c,diffuse:[1,1,1],specular:[1,1,1],intensity:p,range:Number.MAX_VALUE,_writeLightUbo:(e,i)=>{const n=i,t=g.worldMatrix;e[n]=t[12],e[n+1]=t[13],e[n+2]=t[14],e[n+3]=2,e[n+4]=g.diffuse[0]*g.intensity,e[n+5]=g.diffuse[1]*g.intensity,e[n+6]=g.diffuse[2]*g.intensity,e[n+7]=g.range,e[n+8]=g.specular[0]*g.intensity,e[n+9]=g.specular[1]*g.intensity,e[n+10]=g.specular[2]*g.intensity,e[n+11]=g.exponent,e[n+12]=t[8],e[n+13]=t[9],e[n+14]=t[10],e[n+15]=b}},l,f);return Object.defineProperty(g,"angle",{get:()=>y,set(e){e!==y&&(y=e,b=Math.cos(.5*e),f.bump())},configurable:!0,enumerable:!0}),g}export{o as createSpotLight};
//# sourceMappingURL=spot-light-CRyyaCny.esm.min.js.map