@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{aB as e,bx as i,bz as n,by as t,b4 as s}from"./index-B8IgtevW.esm.min.js";function o(o,r,a,c,p=1){const l=e(),{wm:u,onDirty:y,lvs:d}=i(()=>n(g.direction.x,g.direction.y,g.direction.z,g.position.x,g.position.y,g.position.z,l));let f=a,b=Math.cos(.5*a);const g=t({lightType:"spot",children:[],position:new s(o[0],o[1],o[2],y),direction:new s(r[0],r[1],r[2],y),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}},u,d);return Object.defineProperty(g,"angle",{get:()=>f,set(e){e!==f&&(f=e,b=Math.cos(.5*e),d.b())},configurable:!0,enumerable:!0}),g}export{o as createSpotLight};
//# sourceMappingURL=spot-light-BAOHIHBr.esm.min.js.map