-
Notifications
You must be signed in to change notification settings - Fork 2
/
aframe-area-light-component.js.map
1 lines (1 loc) · 6.58 KB
/
aframe-area-light-component.js.map
1
{"version":3,"sources":["webpack:///webpack/bootstrap cbdfdd777ea7884199cb","webpack:///./index.js"],"names":["AFRAME","Error","THREE","registerComponent","schema","intensity","type","default","color","width","height","helperColor","undefined","showHelper","init","setHelperColor","bind","rectLight","RectAreaLight","data","position","set","el","object3D","add","rectLightHelper","RectAreaLightHelper","x","children","forEach","node","material","update","oldData","visible"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;ACtCA;;;;;AAKA;AACA;;AAEA,KAAI,OAAOA,MAAP,KAAkB,WAAtB,EAAmC;AACjC,SAAM,IAAIC,KAAJ,CAAU,8DAAV,CAAN;AACD;;AAED,KAAI,OAAOC,KAAP,KAAiB,WAArB,EAAkC;AAChC,SAAM,IAAID,KAAJ,CAAU,6DAAV,CAAN;AACD;;AAEDD,QAAOG,iBAAP,CAAyB,YAAzB,EAAuC;AACrCC,WAAQ;AACNC,gBAAW;AACTC,aAAM,QADG;AAETC,gBAAS;AAFA,MADL;AAKNC,YAAO;AACLF,aAAM,OADD;AAELC,gBAAS;AAFJ,MALD;AASNE,YAAO;AACLH,aAAM,QADD;AAELC,gBAAS;AAFJ,MATD;AAaNG,aAAQ;AACNJ,aAAM,QADA;AAENC,gBAAS;AAFH,MAbF;AAiBNI,kBAAa;AACXL,aAAM,OADK;AAEXC,gBAASK;AAFE,MAjBP;AAqBNC,iBAAY;AACVP,aAAM,SADI;AAEVC,gBAAS;AAFC;AArBN,IAD6B;;AA4BrCO,SAAM,gBAAW;AACf,UAAKC,cAAL,GAAsB,KAAKA,cAAL,CAAoBC,IAApB,CAAyB,IAAzB,CAAtB;;AAEA,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IAAL,CAAUd,SAArC;AACA,UAAKY,SAAL,CAAeR,KAAf,GAAuB,KAAKU,IAAL,CAAUV,KAAjC;AACA,UAAKQ,SAAL,CAAeP,MAAf,GAAwB,KAAKS,IAAL,CAAUT,MAAlC;AACA,UAAKO,SAAL,CAAeT,KAAf,CAAqBa,GAArB,CAA0B,KAAKF,IAAL,CAAUX,KAApC;;AAEA,SAAI,KAAKiB,eAAL,KAAyBb,SAA7B,EAAwC;AACtC,YAAKa,eAAL,CAAqBS,OAArB,GAA+B,KAAKf,IAAL,CAAUN,UAAzC;;AAEA;AACA,YAAKY,eAAL,CAAqBO,MAArB;;AAEA,WAAI,KAAKb,IAAL,CAAUR,WAAV,KAA0BC,SAA9B,EAAyC;AACvC,cAAKG,cAAL,CAAoB,KAAKI,IAAL,CAAUR,WAA9B;AACD,QAFD,MAEO;AACL,cAAKI,cAAL,CAAoB,KAAKI,IAAL,CAAUX,KAA9B;AACD;AAGF;AACF;AAhFoC,EAAvC,E","file":"aframe-area-light-component.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap cbdfdd777ea7884199cb","/**\n * A-Frame Wrapper for THREE.JS RectAreaLight\n * @author Mo Kargas (DEVLAD) [email protected]\n */\n\n/* global AFRAME */\n/* global THREE */\n\nif (typeof AFRAME === 'undefined') {\n throw new Error('Component attempted to register before AFRAME was available.')\n}\n\nif (typeof THREE === 'undefined') {\n throw new Error('Component attempted to register before THREE was available.')\n}\n\nAFRAME.registerComponent('area-light', {\n schema: {\n intensity: {\n type: 'number',\n default: 1.0\n },\n color: {\n type: 'color',\n default: '#FFFFFF'\n },\n width: {\n type: 'number',\n default: 2.0\n },\n height: {\n type: 'number',\n default: 2.0\n },\n helperColor: {\n type: 'color',\n default: undefined\n },\n showHelper: {\n type: 'boolean',\n default: true\n },\n },\n\n init: function() {\n this.setHelperColor = this.setHelperColor.bind(this)\n\n this.rectLight = new THREE.RectAreaLight(this.data.color, this.data.intensity, this.data.width, this.data.height)\n this.rectLight.position.set(this.data.width / 2, 0, 0)\n this.el.object3D.add(this.rectLight)\n\n //Helper set, assign to scene\n if (this.data.showHelper) {\n\n this.rectLightHelper = new THREE.RectAreaLightHelper(this.rectLight)\n this.rectLightHelper.position.set(this.rectLight.position.x, 0, 0)\n this.el.object3D.add(this.rectLightHelper)\n\n //Determine if we have a different helperColor set\n if (this.data.helperColor !== undefined) {\n this.setHelperColor(this.data.helperColor)\n } else {\n this.setHelperColor(this.data.color)\n }\n }\n\n },\n\n setHelperColor: function(color) {\n //Set helper material color if enabled\n //NOTE: RectLightHelper consists of submeshes https://github.com/mrdoob/three.js/blob/master/src/helpers/RectAreaLightHelper.js\n this.rectLightHelper.children.forEach(node => node.material.color.set(color))\n },\n\n update: function(oldData) {\n\n //Update light values\n this.rectLight.intensity = this.data.intensity\n this.rectLight.width = this.data.width\n this.rectLight.height = this.data.height\n this.rectLight.color.set( this.data.color )\n\n if (this.rectLightHelper !== undefined) {\n this.rectLightHelper.visible = this.data.showHelper\n\n //Update, as child light may have changed dimensions\n this.rectLightHelper.update()\n\n if (this.data.helperColor !== undefined) {\n this.setHelperColor(this.data.helperColor)\n } else {\n this.setHelperColor(this.data.color)\n }\n\n\n }\n }\n});\n\n\n\n// WEBPACK FOOTER //\n// ./index.js"],"sourceRoot":""}