rogue-engine-user-scripts.js 111 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("rogue-engine"), require("three"));
  4. else if(typeof define === 'function' && define.amd)
  5. define(["rogue-engine", "three"], factory);
  6. else if(typeof exports === 'object')
  7. exports["rogue-engine-user-scripts"] = factory(require("rogue-engine"), require("three"));
  8. else
  9. root["rogue-engine-user-scripts"] = factory(root["rogue-engine"], root["three"]);
  10. })(self, function(__WEBPACK_EXTERNAL_MODULE_rogue_engine__, __WEBPACK_EXTERNAL_MODULE_three__) {
  11. return /******/ (() => { // webpackBootstrap
  12. /******/ "use strict";
  13. /******/ var __webpack_modules__ = ({
  14. /***/ "./Assets/Components/CombatLogic.re.js":
  15. /*!*********************************************!*\
  16. !*** ./Assets/Components/CombatLogic.re.js ***!
  17. \*********************************************/
  18. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  19. __webpack_require__.r(__webpack_exports__);
  20. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  21. /* harmony export */ "default": () => (/* binding */ CombatLogic)
  22. /* harmony export */ });
  23. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  24. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  25. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ "three");
  26. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__);
  27. /* harmony import */ var _Library_SimpleTweens__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Library/SimpleTweens */ "./Assets/Components/Library/SimpleTweens.js");
  28. /* harmony import */ var _TileRaycastReceiver_re__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./TileRaycastReceiver.re */ "./Assets/Components/TileRaycastReceiver.re.js");
  29. /* harmony import */ var _Library_Easings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Library/Easings */ "./Assets/Components/Library/Easings.js");
  30. /* harmony import */ var _Library_AsyncLoader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Library/AsyncLoader */ "./Assets/Components/Library/AsyncLoader.js");
  31. /* harmony import */ var _Pathway_re__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Pathway.re */ "./Assets/Components/Pathway.re.js");
  32. var __defProp = Object.defineProperty;
  33. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  34. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  35. var __decorateClass = (decorators, target, key, kind) => {
  36. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  37. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  38. if (decorator = decorators[i])
  39. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  40. if (kind && result)
  41. __defProp(target, key, result);
  42. return result;
  43. };
  44. class CombatLogic extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
  45. constructor() {
  46. super(...arguments);
  47. this.tileMaterials = [];
  48. this.boardDimensions = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2(8, 8);
  49. this.maxColors = 5;
  50. this.tweenManager = new _Library_SimpleTweens__WEBPACK_IMPORTED_MODULE_2__.TweenManager();
  51. this.loader = new _Library_AsyncLoader__WEBPACK_IMPORTED_MODULE_5__["default"]();
  52. this.selectedTiles = [];
  53. this.movesRemaining = 8;
  54. this.score = 0;
  55. }
  56. awake() {
  57. this.tweenManager.awake();
  58. }
  59. start() {
  60. for (let child of this.playGrid.children) {
  61. this.playGrid.remove(child);
  62. }
  63. for (let i = 0; i < this.boardDimensions.x * this.boardDimensions.y; i++) {
  64. let position = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2(i % this.boardDimensions.x, Math.floor(i / this.boardDimensions.x));
  65. this.instantiateTile(position, Math.floor(1500 * Math.random()) + 1800);
  66. }
  67. this.tweenManager.start();
  68. }
  69. instantiateTile(gridPosition, delay, startingY = 14, easingFunction = _Library_Easings__WEBPACK_IMPORTED_MODULE_4__["default"].Elastic.EaseOut) {
  70. let tile = this.tile.instantiate(this.playGrid);
  71. let component = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.getComponent(_TileRaycastReceiver_re__WEBPACK_IMPORTED_MODULE_3__["default"], tile);
  72. component.initialize(gridPosition, this.boardDimensions, this.tileMaterials[Math.floor(Math.random() * Math.min(this.maxColors, this.tileMaterials.length))], this.hoverMaterial, this.tweenManager, delay, startingY, easingFunction);
  73. }
  74. update() {
  75. this.tweenManager.update();
  76. if (rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse.getButtonUp(0) || rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.touch.endTouches.length > 0) {
  77. let pathway = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.getComponent(_Pathway_re__WEBPACK_IMPORTED_MODULE_6__["default"], this.playGrid);
  78. if (pathway) {
  79. pathway.clearPoints();
  80. }
  81. if (this.selectedTiles.length == 1) {
  82. this.selectedTiles.length = 0;
  83. }
  84. if (this.selectedTiles.length > 1 && this.selectedTiles.length < 5) {
  85. this.movesRemaining--;
  86. }
  87. if (this.selectedTiles.length >= 5) {
  88. this.movesRemaining += Math.floor((this.selectedTiles.length - 5) / 3);
  89. }
  90. let moveScore = this.selectedTiles.length * 10;
  91. this.selectedTiles.forEach((tileComponent) => {
  92. moveScore *= Math.max(1, Math.floor(this.selectedTiles.indexOf(tileComponent) / 5));
  93. tileComponent.remove(this.tweenManager);
  94. this.instantiateTile(tileComponent.object3d.gridPosition, Math.floor(1500 * Math.random()) + 300, 14, _Library_Easings__WEBPACK_IMPORTED_MODULE_4__["default"].Exponential.EaseOut);
  95. });
  96. this.selectedTiles.length = 0;
  97. this.score += moveScore;
  98. }
  99. if (rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.keyboard.getKeyUp("Escape")) {
  100. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.loadScene("Main Menu");
  101. }
  102. if (this.movesRemaining == 0) {
  103. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.loadScene("World Map");
  104. }
  105. }
  106. addTile(tileComponent) {
  107. let isAdded = false;
  108. if (this.isStepBack(tileComponent)) {
  109. this.selectedTiles.pop(tileComponent);
  110. } else if (this.isValidTileToSelect(tileComponent)) {
  111. this.selectedTiles.push(tileComponent);
  112. isAdded = true;
  113. }
  114. let pathway = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.getComponent(_Pathway_re__WEBPACK_IMPORTED_MODULE_6__["default"], this.playGrid);
  115. if (pathway) {
  116. pathway.recomputePath(this.selectedTiles);
  117. }
  118. return [isAdded, this.selectedTiles];
  119. }
  120. isValidTileToSelect(tileComponent) {
  121. if (this.selectedTiles.length == 0) {
  122. return true;
  123. }
  124. let lastAddedTile = this.selectedTiles[this.selectedTiles.length - 1];
  125. let initialColor = lastAddedTile.getOriginalMaterial().name;
  126. return this.selectedTiles.indexOf(tileComponent) == -1 && tileComponent.getOriginalMaterial().name == initialColor && this.isNearbyTile(lastAddedTile.object3d.gridPosition, tileComponent.object3d.gridPosition);
  127. }
  128. isNearbyTile(startingPosition, newPosition) {
  129. return (newPosition.x == startingPosition.x - 1 || newPosition.x == startingPosition.x || newPosition.x == startingPosition.x + 1) && (newPosition.y == startingPosition.y - 1 || newPosition.y == startingPosition.y || newPosition.y == startingPosition.y + 1);
  130. }
  131. isStepBack(tileComponent) {
  132. return this.selectedTiles.length > 1 && this.selectedTiles.indexOf(tileComponent) == this.selectedTiles.length - 2;
  133. }
  134. }
  135. __name(CombatLogic, "CombatLogic");
  136. __decorateClass([
  137. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Object3D")
  138. ], CombatLogic.prototype, "playGrid", 2);
  139. __decorateClass([
  140. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Prefab")
  141. ], CombatLogic.prototype, "tile", 2);
  142. __decorateClass([
  143. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Material")
  144. ], CombatLogic.prototype, "hoverMaterial", 2);
  145. __decorateClass([
  146. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.PropList("Material")
  147. ], CombatLogic.prototype, "tileMaterials", 2);
  148. __decorateClass([
  149. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector2")
  150. ], CombatLogic.prototype, "boardDimensions", 2);
  151. __decorateClass([
  152. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  153. ], CombatLogic.prototype, "maxColors", 2);
  154. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(CombatLogic);
  155. /***/ }),
  156. /***/ "./Assets/Components/FloatObject.re.js":
  157. /*!*********************************************!*\
  158. !*** ./Assets/Components/FloatObject.re.js ***!
  159. \*********************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. __webpack_require__.r(__webpack_exports__);
  162. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  163. /* harmony export */ "default": () => (/* binding */ FloatObject)
  164. /* harmony export */ });
  165. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  166. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  167. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ "three");
  168. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__);
  169. var __defProp = Object.defineProperty;
  170. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  171. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  172. var __decorateClass = (decorators, target, key, kind) => {
  173. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  174. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  175. if (decorator = decorators[i])
  176. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  177. if (kind && result)
  178. __defProp(target, key, result);
  179. return result;
  180. };
  181. class FloatObject extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
  182. constructor() {
  183. super(...arguments);
  184. this.elapsed = 0;
  185. this.amplitude = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 1, 0);
  186. this.offset = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0);
  187. this.period = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 4, 0);
  188. }
  189. awake() {
  190. }
  191. start() {
  192. this.elapsed = 0;
  193. }
  194. update() {
  195. this.elapsed += rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.deltaTime;
  196. this.object3d.position.x = this.amplitude.x * Math.cos(this.period.x * this.elapsed) + this.offset.x;
  197. this.object3d.position.y = this.amplitude.y * Math.sin(this.period.y * this.elapsed) + this.offset.y;
  198. this.object3d.position.z = this.amplitude.z * Math.sin(this.period.z * this.elapsed) + this.offset.z;
  199. }
  200. }
  201. __name(FloatObject, "FloatObject");
  202. __decorateClass([
  203. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector3")
  204. ], FloatObject.prototype, "amplitude", 2);
  205. __decorateClass([
  206. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector3")
  207. ], FloatObject.prototype, "offset", 2);
  208. __decorateClass([
  209. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector3")
  210. ], FloatObject.prototype, "period", 2);
  211. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(FloatObject);
  212. /***/ }),
  213. /***/ "./Assets/Components/HouseRaycastReceiver.re.js":
  214. /*!******************************************************!*\
  215. !*** ./Assets/Components/HouseRaycastReceiver.re.js ***!
  216. \******************************************************/
  217. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  218. __webpack_require__.r(__webpack_exports__);
  219. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  220. /* harmony export */ "default": () => (/* binding */ HouseRaycastReceiver)
  221. /* harmony export */ });
  222. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  223. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  224. /* harmony import */ var _RaycastReceiver_re__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RaycastReceiver.re */ "./Assets/Components/RaycastReceiver.re.js");
  225. var __defProp = Object.defineProperty;
  226. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  227. class HouseRaycastReceiver extends _RaycastReceiver_re__WEBPACK_IMPORTED_MODULE_1__["default"] {
  228. constructor() {
  229. super(...arguments);
  230. this.isHovered = false;
  231. this.elapsed = 0;
  232. this.clearHoverId = 0;
  233. }
  234. awake() {
  235. }
  236. start() {
  237. this.elapsed = 0;
  238. }
  239. update() {
  240. if (this.isHovered) {
  241. this.elapsed += rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.deltaTime;
  242. this.object3d.position.y = 0.5 * Math.sin(4 * this.elapsed) + 1;
  243. if (rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse.getButtonUp(0) || rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.touch.endTouches.length > 0) {
  244. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.style.cursor = "default";
  245. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.loadScene("World Map");
  246. }
  247. } else {
  248. if (this.object3d.position.y != 0) {
  249. this.object3d.position.y = 0;
  250. }
  251. }
  252. }
  253. onMouseOver(intersect) {
  254. if (!this.isHovered) {
  255. this.isHovered = true;
  256. }
  257. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.style.cursor = "pointer";
  258. return false;
  259. }
  260. onMouseOut() {
  261. if (!this.isHovered) {
  262. return;
  263. }
  264. this.isHovered = false;
  265. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.style.cursor = "default";
  266. }
  267. }
  268. __name(HouseRaycastReceiver, "HouseRaycastReceiver");
  269. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(HouseRaycastReceiver);
  270. /***/ }),
  271. /***/ "./Assets/Components/Library/AsyncLoader.js":
  272. /*!**************************************************!*\
  273. !*** ./Assets/Components/Library/AsyncLoader.js ***!
  274. \**************************************************/
  275. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  276. __webpack_require__.r(__webpack_exports__);
  277. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  278. /* harmony export */ "default": () => (/* binding */ AsyncLoader)
  279. /* harmony export */ });
  280. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  281. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  282. var __defProp = Object.defineProperty;
  283. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  284. class AsyncLoader {
  285. loadStaticText(filepath) {
  286. return new Promise((success, failure) => {
  287. fetch(rogue_engine__WEBPACK_IMPORTED_MODULE_0__.getStaticPath(filepath)).then((result) => {
  288. result.text().then((text) => {
  289. success(text);
  290. }, (error) => {
  291. failure(error);
  292. });
  293. }, (error) => {
  294. failure(error);
  295. });
  296. });
  297. }
  298. }
  299. __name(AsyncLoader, "AsyncLoader");
  300. /***/ }),
  301. /***/ "./Assets/Components/Library/Easings.js":
  302. /*!**********************************************!*\
  303. !*** ./Assets/Components/Library/Easings.js ***!
  304. \**********************************************/
  305. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  306. __webpack_require__.r(__webpack_exports__);
  307. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  308. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  309. /* harmony export */ });
  310. var Easing = {};
  311. Easing.Linear = {};
  312. Easing.Linear.EaseNone = (percentageComplete) => percentageComplete;
  313. Easing.Quadratic = {};
  314. Easing.Quadratic.EaseIn = (percentageComplete) => percentageComplete * percentageComplete;
  315. Easing.Quadratic.EaseOut = (percentageComplete) => -percentageComplete * (percentageComplete - 2);
  316. Easing.Quadratic.EaseInOut = (percentageComplete) => {
  317. if ((percentageComplete *= 2) < 1)
  318. return 0.5 * percentageComplete * percentageComplete;
  319. return -0.5 * (--percentageComplete * (percentageComplete - 2) - 1);
  320. };
  321. Easing.Cubic = {};
  322. Easing.Cubic.EaseIn = (percentageComplete) => percentageComplete * percentageComplete * percentageComplete;
  323. Easing.Cubic.EaseOut = (percentageComplete) => --percentageComplete * percentageComplete * percentageComplete + 1;
  324. Easing.Cubic.EaseInOut = (percentageComplete) => {
  325. if ((percentageComplete *= 2) < 1)
  326. return 0.5 * percentageComplete * percentageComplete * percentageComplete;
  327. return 0.5 * ((percentageComplete -= 2) * percentageComplete * percentageComplete + 2);
  328. };
  329. Easing.Quartic = {};
  330. Easing.Quartic.EaseIn = (percentageComplete) => percentageComplete * percentageComplete * percentageComplete * percentageComplete;
  331. Easing.Quartic.EaseOut = (percentageComplete) => -(--percentageComplete * percentageComplete * percentageComplete * percentageComplete - 1);
  332. Easing.Quartic.EaseInOut = (percentageComplete) => {
  333. if ((percentageComplete *= 2) < 1)
  334. return 0.5 * percentageComplete * percentageComplete * percentageComplete * percentageComplete;
  335. return -0.5 * ((percentageComplete -= 2) * percentageComplete * percentageComplete * percentageComplete - 2);
  336. };
  337. Easing.Quintic = {};
  338. Easing.Quintic.EaseIn = (percentageComplete) => percentageComplete * percentageComplete * percentageComplete * percentageComplete * percentageComplete;
  339. Easing.Quintic.EaseOut = (percentageComplete) => (percentageComplete = percentageComplete - 1) * percentageComplete * percentageComplete * percentageComplete * percentageComplete + 1;
  340. Easing.Quintic.EaseInOut = (percentageComplete) => {
  341. if ((percentageComplete *= 2) < 1)
  342. return 0.5 * percentageComplete * percentageComplete * percentageComplete * percentageComplete * percentageComplete;
  343. return 0.5 * ((percentageComplete -= 2) * percentageComplete * percentageComplete * percentageComplete * percentageComplete + 2);
  344. };
  345. Easing.Sinusoidal = {};
  346. Easing.Sinusoidal.EaseIn = (percentageComplete) => -Math.cos(percentageComplete * Math.PI / 2) + 1;
  347. Easing.Sinusoidal.EaseOut = (percentageComplete) => Math.sin(percentageComplete * Math.PI / 2);
  348. Easing.Sinusoidal.EaseInOut = (percentageComplete) => -0.5 * (Math.cos(Math.PI * percentageComplete) - 1);
  349. Easing.Exponential = {};
  350. Easing.Exponential.EaseIn = (percentageComplete) => {
  351. return percentageComplete == 0 ? 0 : Math.pow(2, 10 * (percentageComplete - 1));
  352. };
  353. Easing.Exponential.EaseOut = (percentageComplete) => {
  354. return percentageComplete == 1 ? 1 : -Math.pow(2, -10 * percentageComplete) + 1;
  355. };
  356. Easing.Exponential.EaseInOut = (percentageComplete) => {
  357. if (percentageComplete == 0)
  358. return 0;
  359. if (percentageComplete == 1)
  360. return 1;
  361. if ((percentageComplete *= 2) < 1)
  362. return 0.5 * Math.pow(2, 10 * (percentageComplete - 1));
  363. return 0.5 * (-Math.pow(2, -10 * (percentageComplete - 1)) + 2);
  364. };
  365. Easing.Circular = {};
  366. Easing.Circular.EaseIn = (percentageComplete) => -(Math.sqrt(1 - percentageComplete * percentageComplete) - 1);
  367. Easing.Circular.EaseOut = (percentageComplete) => Math.sqrt(1 - --percentageComplete * percentageComplete);
  368. Easing.Circular.EaseInOut = (percentageComplete) => {
  369. if ((percentageComplete /= 0.5) < 1)
  370. return -0.5 * (Math.sqrt(1 - percentageComplete * percentageComplete) - 1);
  371. return 0.5 * (Math.sqrt(1 - (percentageComplete -= 2) * percentageComplete) + 1);
  372. };
  373. Easing.Elastic = {};
  374. Easing.Elastic.EaseIn = (percentageComplete) => {
  375. var s, a = 0.1, p = 0.4;
  376. if (percentageComplete == 0)
  377. return 0;
  378. if (percentageComplete == 1)
  379. return 1;
  380. if (!p)
  381. p = 0.3;
  382. if (!a || a < 1) {
  383. a = 1;
  384. s = p / 4;
  385. } else
  386. s = p / (2 * Math.PI) * Math.asin(1 / a);
  387. return -(a * Math.pow(2, 10 * (percentageComplete -= 1)) * Math.sin((percentageComplete - s) * (2 * Math.PI) / p));
  388. };
  389. Easing.Elastic.EaseOut = (percentageComplete) => {
  390. var s, a = 0.1, p = 0.4;
  391. if (percentageComplete == 0)
  392. return 0;
  393. if (percentageComplete == 1)
  394. return 1;
  395. if (!p)
  396. p = 0.3;
  397. if (!a || a < 1) {
  398. a = 1;
  399. s = p / 4;
  400. } else
  401. s = p / (2 * Math.PI) * Math.asin(1 / a);
  402. return a * Math.pow(2, -10 * percentageComplete) * Math.sin((percentageComplete - s) * (2 * Math.PI) / p) + 1;
  403. };
  404. Easing.Elastic.EaseInOut = (percentageComplete) => {
  405. var s, a = 0.1, p = 0.4;
  406. if (percentageComplete == 0)
  407. return 0;
  408. if (percentageComplete == 1)
  409. return 1;
  410. if (!p)
  411. p = 0.3;
  412. if (!a || a < 1) {
  413. a = 1;
  414. s = p / 4;
  415. } else
  416. s = p / (2 * Math.PI) * Math.asin(1 / a);
  417. if ((percentageComplete *= 2) < 1)
  418. return -0.5 * (a * Math.pow(2, 10 * (percentageComplete -= 1)) * Math.sin((percentageComplete - s) * (2 * Math.PI) / p));
  419. return a * Math.pow(2, -10 * (percentageComplete -= 1)) * Math.sin((percentageComplete - s) * (2 * Math.PI) / p) * 0.5 + 1;
  420. };
  421. Easing.Back = {};
  422. Easing.Back.EaseIn = (percentageComplete) => {
  423. var s = 1.70158;
  424. return percentageComplete * percentageComplete * ((s + 1) * percentageComplete - s);
  425. };
  426. Easing.Back.EaseOut = (percentageComplete) => {
  427. var s = 1.70158;
  428. return (percentageComplete = percentageComplete - 1) * percentageComplete * ((s + 1) * percentageComplete + s) + 1;
  429. };
  430. Easing.Back.EaseInOut = (percentageComplete) => {
  431. var s = 1.70158 * 1.525;
  432. if ((percentageComplete *= 2) < 1)
  433. return 0.5 * (percentageComplete * percentageComplete * ((s + 1) * percentageComplete - s));
  434. return 0.5 * ((percentageComplete -= 2) * percentageComplete * ((s + 1) * percentageComplete + s) + 2);
  435. };
  436. Easing.Bounce = {};
  437. Easing.Bounce.EaseIn = (percentageComplete) => 1 - Easing.Bounce.EaseOut(1 - percentageComplete);
  438. Easing.Bounce.EaseOut = (percentageComplete) => {
  439. if ((percentageComplete /= 1) < 1 / 2.75) {
  440. return 7.5625 * percentageComplete * percentageComplete;
  441. } else if (percentageComplete < 2 / 2.75) {
  442. return 7.5625 * (percentageComplete -= 1.5 / 2.75) * percentageComplete + 0.75;
  443. } else if (percentageComplete < 2.5 / 2.75) {
  444. return 7.5625 * (percentageComplete -= 2.25 / 2.75) * percentageComplete + 0.9375;
  445. } else {
  446. return 7.5625 * (percentageComplete -= 2.625 / 2.75) * percentageComplete + 0.984375;
  447. }
  448. };
  449. Easing.Bounce.EaseInOut = (percentageComplete) => {
  450. if (percentageComplete < 0.5)
  451. return Easing.Bounce.EaseIn(percentageComplete * 2) * 0.5;
  452. return Easing.Bounce.EaseOut(percentageComplete * 2 - 1) * 0.5 + 0.5;
  453. };
  454. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Easing);
  455. /***/ }),
  456. /***/ "./Assets/Components/Library/GameData.js":
  457. /*!***********************************************!*\
  458. !*** ./Assets/Components/Library/GameData.js ***!
  459. \***********************************************/
  460. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  461. __webpack_require__.r(__webpack_exports__);
  462. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  463. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  464. /* harmony export */ });
  465. var GameData = {};
  466. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GameData);
  467. /***/ }),
  468. /***/ "./Assets/Components/Library/SimpleTweens.js":
  469. /*!***************************************************!*\
  470. !*** ./Assets/Components/Library/SimpleTweens.js ***!
  471. \***************************************************/
  472. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  473. __webpack_require__.r(__webpack_exports__);
  474. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  475. /* harmony export */ "TweenManager": () => (/* binding */ TweenManager),
  476. /* harmony export */ "SimpleTween": () => (/* binding */ SimpleTween)
  477. /* harmony export */ });
  478. /* harmony import */ var _Easings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Easings */ "./Assets/Components/Library/Easings.js");
  479. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  480. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_1__);
  481. var __defProp = Object.defineProperty;
  482. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  483. class TweenManager {
  484. constructor() {
  485. this.activeTweens = [];
  486. this.elapsed = 0;
  487. }
  488. awake() {
  489. }
  490. start() {
  491. this.elapsed = 0;
  492. }
  493. update() {
  494. this.elapsed += rogue_engine__WEBPACK_IMPORTED_MODULE_1__.Runtime.deltaTime;
  495. let tweensToRemove = [];
  496. this.activeTweens.forEach((tween) => {
  497. if (tween.update(this.elapsed)) {
  498. tweensToRemove.push(tween);
  499. }
  500. });
  501. for (let i = tweensToRemove.length - 1; i >= 0; i--) {
  502. this.remove(tweensToRemove[i]);
  503. }
  504. }
  505. add(simpleTween) {
  506. this.activeTweens.push(simpleTween);
  507. simpleTween.start(this.elapsed);
  508. }
  509. remove(simpleTween) {
  510. delete this.activeTweens[this.activeTweens.indexOf(simpleTween)];
  511. }
  512. }
  513. __name(TweenManager, "TweenManager");
  514. class SimpleTween {
  515. constructor(initialObject, targetProperties, duration = 1e3, easingFunction = _Easings__WEBPACK_IMPORTED_MODULE_0__["default"].Linear.EaseNone, onComplete = () => {
  516. }) {
  517. this.initialObject = initialObject;
  518. this.targetProperties = targetProperties;
  519. this.duration = duration / 1e3;
  520. this.easingFunction = easingFunction;
  521. this.onComplete = onComplete;
  522. }
  523. start(elapsed) {
  524. this.copy = {};
  525. for (let key in this.targetProperties) {
  526. this.copy[key] = this.initialObject[key];
  527. }
  528. this.begin = elapsed;
  529. }
  530. update(elapsed) {
  531. if (elapsed >= this.begin + this.duration) {
  532. for (let key in this.targetProperties) {
  533. this.initialObject[key] = this.targetProperties[key];
  534. }
  535. this.onComplete();
  536. return true;
  537. }
  538. let delta = (elapsed - this.begin) / this.duration;
  539. for (let key in this.targetProperties) {
  540. this.initialObject[key] = (this.targetProperties[key] - this.copy[key]) * this.easingFunction(delta) + this.copy[key];
  541. }
  542. return false;
  543. }
  544. }
  545. __name(SimpleTween, "SimpleTween");
  546. /***/ }),
  547. /***/ "./Assets/Components/OrbitCamera.re.js":
  548. /*!*********************************************!*\
  549. !*** ./Assets/Components/OrbitCamera.re.js ***!
  550. \*********************************************/
  551. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  552. __webpack_require__.r(__webpack_exports__);
  553. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  554. /* harmony export */ "default": () => (/* binding */ OrbitCamera)
  555. /* harmony export */ });
  556. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  557. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  558. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ "three");
  559. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__);
  560. var __defProp = Object.defineProperty;
  561. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  562. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  563. var __decorateClass = (decorators, target, key, kind) => {
  564. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  565. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  566. if (decorator = decorators[i])
  567. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  568. if (kind && result)
  569. __defProp(target, key, result);
  570. return result;
  571. };
  572. class OrbitCamera extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
  573. constructor() {
  574. super(...arguments);
  575. this.rotateStart = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2();
  576. this.rotateEnd = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2();
  577. this.rotateDelta = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2();
  578. this.enableRotate = true;
  579. this.rotateSpeed = 1;
  580. this.minAzimuthAngle = -Infinity;
  581. this.maxAzimuthAngle = Infinity;
  582. this.minPolarAngle = 0;
  583. this.maxPolarAngle = Math.PI;
  584. this.enableDolly = true;
  585. this.dollySpeed = 1;
  586. this.minDistance = 1;
  587. this.maxDistance = 50;
  588. this.scale = 1;
  589. this.EPS = 1e-6;
  590. this.twoPI = 2 * Math.PI;
  591. this.spherical = new three__WEBPACK_IMPORTED_MODULE_1__.Spherical();
  592. this.sphericalDelta = new three__WEBPACK_IMPORTED_MODULE_1__.Spherical();
  593. this.offset = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3();
  594. this.rotateMouseButton = 2;
  595. this.quat = new three__WEBPACK_IMPORTED_MODULE_1__.Quaternion().setFromUnitVectors(new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 1, 0), new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 1, 0));
  596. this.quatInverse = this.quat.clone().invert();
  597. this.lastPosition = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3();
  598. this.lastQuaternion = new three__WEBPACK_IMPORTED_MODULE_1__.Quaternion();
  599. this.initialOffset = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3();
  600. }
  601. awake() {
  602. }
  603. start() {
  604. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.addEventListener("contextmenu", (event) => {
  605. event.preventDefault();
  606. });
  607. this.quat = new three__WEBPACK_IMPORTED_MODULE_1__.Quaternion().setFromUnitVectors(this.object3d.up, new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 1, 0));
  608. this.quatInverse = this.quat.clone().invert();
  609. this.initialOffset.copy(this.object3d.position).sub(this.target.position);
  610. this.offset.copy(this.initialOffset);
  611. }
  612. update() {
  613. let normalizedScreenPosition = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2(0, 0);
  614. this.normalizeScreenInput(rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse, normalizedScreenPosition);
  615. if (this.enableRotate && rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse.getButtonDown(this.rotateMouseButton)) {
  616. this.rotateStart.set(normalizedScreenPosition.x, normalizedScreenPosition.y);
  617. }
  618. if (this.enableRotate && rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse.getButtonPressed(this.rotateMouseButton)) {
  619. this.rotateEnd.set(normalizedScreenPosition.x, normalizedScreenPosition.y);
  620. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart).multiplyScalar(this.rotateSpeed);
  621. this.rotateLeft(this.twoPI * this.rotateDelta.x);
  622. this.rotateUp(this.twoPI * -this.rotateDelta.y);
  623. this.rotateStart.copy(this.rotateEnd);
  624. }
  625. if (this.enableDolly && rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse.wheelY > 0) {
  626. this.dollyOut();
  627. }
  628. if (this.enableDolly && rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse.wheelY < 0) {
  629. this.dollyIn();
  630. }
  631. this.updateCamera();
  632. }
  633. rotateLeft(angle) {
  634. this.sphericalDelta.theta -= angle;
  635. }
  636. rotateUp(angle) {
  637. this.sphericalDelta.phi -= angle;
  638. }
  639. updateCamera() {
  640. this.offset.applyQuaternion(this.quat);
  641. this.spherical.setFromVector3(this.offset);
  642. this.spherical.theta += this.sphericalDelta.theta;
  643. this.spherical.phi += this.sphericalDelta.phi;
  644. let min = this.minAzimuthAngle;
  645. let max = this.maxAzimuthAngle;
  646. if (isFinite(min) && isFinite(max)) {
  647. if (min < -Math.PI) {
  648. min += this.twoPI;
  649. } else if (min > Math.PI) {
  650. min -= this.twoPI;
  651. }
  652. if (max < -Math.PI) {
  653. max += this.twoPI;
  654. } else if (max > Math.PI) {
  655. max -= this.twoPI;
  656. }
  657. if (min <= max) {
  658. this.spherical.theta = Math.max(min, Math.min(max, this.spherical.theta));
  659. } else {
  660. this.spherical.theta = this.spherical.theta > (min + max) / 2 ? Math.max(min, this.spherical.theta) : Math.min(max, this.spherical.theta);
  661. }
  662. }
  663. this.spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this.spherical.phi));
  664. this.spherical.makeSafe();
  665. this.spherical.radius *= this.scale;
  666. this.spherical.radius = Math.max(this.minDistance, Math.min(this.maxDistance, this.spherical.radius));
  667. this.offset.setFromSpherical(this.spherical);
  668. this.offset.applyQuaternion(this.quatInverse);
  669. this.object3d.position.copy(this.target.position).add(this.offset);
  670. this.object3d.lookAt(this.target.position);
  671. this.sphericalDelta.set(0, 0, 0);
  672. this.scale = 1;
  673. if (this.lastPosition.distanceToSquared(this.object3d.position) > this.EPS || 8 * (1 - this.lastQuaternion.dot(this.object3d.quaternion)) > this.EPS) {
  674. this.lastPosition.copy(this.object3d.position);
  675. this.lastQuaternion.copy(this.object3d.quaternion);
  676. }
  677. }
  678. dollyOut() {
  679. this.scale /= Math.pow(0.95, this.dollySpeed);
  680. }
  681. dollyIn() {
  682. this.scale *= Math.pow(0.95, this.dollySpeed);
  683. }
  684. normalizeScreenInput(browserVector, gameVector) {
  685. const bounds = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.getBoundingClientRect();
  686. gameVector.x = (browserVector.x - bounds.left) / bounds.width * 2 - 1;
  687. gameVector.y = -((browserVector.y - bounds.top) / bounds.height) * 2 + 1;
  688. }
  689. }
  690. __name(OrbitCamera, "OrbitCamera");
  691. __decorateClass([
  692. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Object3D")
  693. ], OrbitCamera.prototype, "target", 2);
  694. __decorateClass([
  695. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Boolean")
  696. ], OrbitCamera.prototype, "enableRotate", 2);
  697. __decorateClass([
  698. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  699. ], OrbitCamera.prototype, "rotateSpeed", 2);
  700. __decorateClass([
  701. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  702. ], OrbitCamera.prototype, "minAzimuthAngle", 2);
  703. __decorateClass([
  704. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  705. ], OrbitCamera.prototype, "maxAzimuthAngle", 2);
  706. __decorateClass([
  707. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  708. ], OrbitCamera.prototype, "minPolarAngle", 2);
  709. __decorateClass([
  710. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  711. ], OrbitCamera.prototype, "maxPolarAngle", 2);
  712. __decorateClass([
  713. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Boolean")
  714. ], OrbitCamera.prototype, "enableDolly", 2);
  715. __decorateClass([
  716. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  717. ], OrbitCamera.prototype, "dollySpeed", 2);
  718. __decorateClass([
  719. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  720. ], OrbitCamera.prototype, "minDistance", 2);
  721. __decorateClass([
  722. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  723. ], OrbitCamera.prototype, "maxDistance", 2);
  724. __decorateClass([
  725. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector3")
  726. ], OrbitCamera.prototype, "offset", 2);
  727. __decorateClass([
  728. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  729. ], OrbitCamera.prototype, "rotateMouseButton", 2);
  730. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(OrbitCamera);
  731. /***/ }),
  732. /***/ "./Assets/Components/ParticleSystem.re.js":
  733. /*!************************************************!*\
  734. !*** ./Assets/Components/ParticleSystem.re.js ***!
  735. \************************************************/
  736. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  737. __webpack_require__.r(__webpack_exports__);
  738. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  739. /* harmony export */ "default": () => (/* binding */ ParticleSystem)
  740. /* harmony export */ });
  741. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  742. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  743. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ "three");
  744. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__);
  745. var __defProp = Object.defineProperty;
  746. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  747. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  748. var __decorateClass = (decorators, target, key, kind) => {
  749. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  750. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  751. if (decorator = decorators[i])
  752. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  753. if (kind && result)
  754. __defProp(target, key, result);
  755. return result;
  756. };
  757. class ParticleSystem extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
  758. constructor() {
  759. super(...arguments);
  760. this.vertexShader = `
  761. uniform float pointMultiplier;
  762. varying vec4 vColor;
  763. void main() {
  764. vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
  765. gl_Position = projectionMatrix * mvPosition;
  766. gl_PointSize = pointMultiplier / gl_Position.w;
  767. vColor = color;
  768. }`;
  769. this.fragmentShader = `
  770. uniform sampler2D diffuseTexture;
  771. varying vec4 vColor;
  772. void main() {
  773. gl_FragColor = texture2D(diffuseTexture, gl_PointCoord) * vColor;
  774. }`;
  775. this.color = new three__WEBPACK_IMPORTED_MODULE_1__.Color(255, 255, 255);
  776. this.alpha = 1;
  777. this.blending = 0;
  778. this.blendingOptions = ["Additive", "Normal", "Multiply", "None", "Subtractive"];
  779. this.max = 500;
  780. this.spawnPerTick = 1;
  781. this.lifespan = 2;
  782. this.initialVelocity = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0);
  783. this.thrustScalar = 0.01;
  784. this.positionRandomBounds = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(1, 1, 1);
  785. this.velocityRandomBounds = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(1, 1, 1);
  786. }
  787. start() {
  788. const bounds = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.getBoundingClientRect();
  789. const uniforms = {
  790. diffuseTexture: {
  791. value: this.texture
  792. },
  793. pointMultiplier: {
  794. value: bounds.width - bounds.left
  795. }
  796. };
  797. this.material = new three__WEBPACK_IMPORTED_MODULE_1__.ShaderMaterial({
  798. uniforms,
  799. vertexShader: this.vertexShader,
  800. fragmentShader: this.fragmentShader,
  801. blending: this.convertBlending(this.blending),
  802. depthTest: true,
  803. depthWrite: false,
  804. transparent: true,
  805. vertexColors: true
  806. });
  807. this.geometry = new three__WEBPACK_IMPORTED_MODULE_1__.BufferGeometry();
  808. this.geometry.setAttribute("position", new three__WEBPACK_IMPORTED_MODULE_1__.Float32BufferAttribute([], 3));
  809. this.geometry.setAttribute("color", new three__WEBPACK_IMPORTED_MODULE_1__.Float32BufferAttribute([], 4));
  810. this.globalPointsObject.geometry = this.geometry;
  811. this.globalPointsObject.material = this.material;
  812. this.particles = [];
  813. this.updateGeometry();
  814. }
  815. convertBlending(selectIndex) {
  816. switch (this.blendingOptions[selectIndex]) {
  817. case "Additive":
  818. return three__WEBPACK_IMPORTED_MODULE_1__.AdditiveBlending;
  819. case "Normal":
  820. return three__WEBPACK_IMPORTED_MODULE_1__.NormalBlending;
  821. case "Multiply":
  822. return three__WEBPACK_IMPORTED_MODULE_1__.MultiplyBlending;
  823. case "None":
  824. return three__WEBPACK_IMPORTED_MODULE_1__.NoBlending;
  825. case "Subtractive":
  826. return three__WEBPACK_IMPORTED_MODULE_1__.SubtractiveBlending;
  827. default:
  828. return three__WEBPACK_IMPORTED_MODULE_1__.AdditiveBlending;
  829. }
  830. }
  831. awake() {
  832. }
  833. update() {
  834. this.addParticles();
  835. this.updateParticles(rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.deltaTime);
  836. this.updateGeometry();
  837. }
  838. addParticles() {
  839. if (this.particles.length >= this.max) {
  840. return;
  841. }
  842. for (let i = 0; i < this.spawnPerTick; i++) {
  843. const life = this.lifespan;
  844. const newPosition = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3();
  845. this.initialLocation.getWorldPosition(newPosition);
  846. newPosition.add(new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(1 * Math.random() - 0.5, 1 * Math.random() - 0.5, 1 * Math.random() - 0.5).multiply(this.positionRandomBounds));
  847. const newVelocity = this.initialVelocity.clone();
  848. newVelocity.add(new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(1 * Math.random() - 0.5, 1 * Math.random() - 0.5, 1 * Math.random() - 0.5).multiply(this.velocityRandomBounds));
  849. this.particles.push({
  850. position: newPosition,
  851. life,
  852. maxLife: life,
  853. velocity: newVelocity,
  854. color: this.color,
  855. alpha: this.alpha
  856. });
  857. }
  858. }
  859. updateGeometry() {
  860. const positions = [];
  861. const colors = [];
  862. for (let p of this.particles) {
  863. positions.push(p.position.x, p.position.y, p.position.z);
  864. colors.push(p.color.r, p.color.g, p.color.b, p.alpha);
  865. }
  866. this.geometry.setAttribute("position", new three__WEBPACK_IMPORTED_MODULE_1__.Float32BufferAttribute(positions, 3));
  867. this.geometry.setAttribute("color", new three__WEBPACK_IMPORTED_MODULE_1__.Float32BufferAttribute(colors, 4));
  868. this.geometry.attributes.position.needsUpdate = true;
  869. this.geometry.attributes.color.needsUpdate = true;
  870. }
  871. updateParticles(deltaTime) {
  872. for (let p of this.particles) {
  873. p.life -= deltaTime;
  874. }
  875. this.particles = this.particles.filter((p) => {
  876. return p.life > 0;
  877. });
  878. for (let p of this.particles) {
  879. p.position.add(p.velocity.clone());
  880. }
  881. let camera = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.currentScene.getObjectByProperty("uuid", rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.activeCamera);
  882. this.particles.sort((a, b) => {
  883. const d1 = camera.position.distanceTo(a.position);
  884. const d2 = camera.position.distanceTo(b.position);
  885. if (d1 > d2) {
  886. return -1;
  887. }
  888. if (d1 < d2) {
  889. return 1;
  890. }
  891. return 0;
  892. });
  893. }
  894. }
  895. __name(ParticleSystem, "ParticleSystem");
  896. __decorateClass([
  897. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Texture")
  898. ], ParticleSystem.prototype, "texture", 2);
  899. __decorateClass([
  900. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Color")
  901. ], ParticleSystem.prototype, "color", 2);
  902. __decorateClass([
  903. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  904. ], ParticleSystem.prototype, "alpha", 2);
  905. __decorateClass([
  906. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Select")
  907. ], ParticleSystem.prototype, "blending", 2);
  908. __decorateClass([
  909. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Object3D")
  910. ], ParticleSystem.prototype, "globalPointsObject", 2);
  911. __decorateClass([
  912. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  913. ], ParticleSystem.prototype, "max", 2);
  914. __decorateClass([
  915. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  916. ], ParticleSystem.prototype, "spawnPerTick", 2);
  917. __decorateClass([
  918. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  919. ], ParticleSystem.prototype, "lifespan", 2);
  920. __decorateClass([
  921. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Object3D")
  922. ], ParticleSystem.prototype, "initialLocation", 2);
  923. __decorateClass([
  924. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector3")
  925. ], ParticleSystem.prototype, "initialVelocity", 2);
  926. __decorateClass([
  927. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Number")
  928. ], ParticleSystem.prototype, "thrustScalar", 2);
  929. __decorateClass([
  930. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector3")
  931. ], ParticleSystem.prototype, "positionRandomBounds", 2);
  932. __decorateClass([
  933. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector3")
  934. ], ParticleSystem.prototype, "velocityRandomBounds", 2);
  935. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(ParticleSystem);
  936. /***/ }),
  937. /***/ "./Assets/Components/Pathway.re.js":
  938. /*!*****************************************!*\
  939. !*** ./Assets/Components/Pathway.re.js ***!
  940. \*****************************************/
  941. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  942. __webpack_require__.r(__webpack_exports__);
  943. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  944. /* harmony export */ "default": () => (/* binding */ Pathway)
  945. /* harmony export */ });
  946. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  947. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  948. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ "three");
  949. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__);
  950. /* harmony import */ var three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/lines/LineGeometry */ "./node_modules/three/examples/jsm/lines/LineGeometry.js");
  951. /* harmony import */ var three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three/examples/jsm/lines/LineMaterial */ "./node_modules/three/examples/jsm/lines/LineMaterial.js");
  952. /* harmony import */ var three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three/examples/jsm/lines/Line2 */ "./node_modules/three/examples/jsm/lines/Line2.js");
  953. var __defProp = Object.defineProperty;
  954. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  955. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  956. var __decorateClass = (decorators, target, key, kind) => {
  957. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  958. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  959. if (decorator = decorators[i])
  960. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  961. if (kind && result)
  962. __defProp(target, key, result);
  963. return result;
  964. };
  965. class Pathway extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
  966. constructor() {
  967. super(...arguments);
  968. this.linePoints = [];
  969. this.colors = [];
  970. this.lineColorShift = new three__WEBPACK_IMPORTED_MODULE_1__.Color(0.1, 0.1, 0.1);
  971. }
  972. awake() {
  973. }
  974. start() {
  975. this.lineGeo = new three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_2__.LineGeometry();
  976. this.lineMat = new three_examples_jsm_lines_LineMaterial__WEBPACK_IMPORTED_MODULE_3__.LineMaterial({
  977. color: 16777215,
  978. linewidth: 5,
  979. vertexColors: true,
  980. dashed: false,
  981. wireframe: false
  982. });
  983. const bounds = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.getBoundingClientRect();
  984. this.lineMat.resolution.set(bounds.width, bounds.height);
  985. }
  986. updateGeometry() {
  987. if (this.linePoints.length < 2) {
  988. return;
  989. }
  990. const positions = [];
  991. const colors = [];
  992. for (let p of this.linePoints) {
  993. positions.push(p.x, p.y, p.z);
  994. }
  995. for (let c of this.colors) {
  996. colors.push(Math.min(1, c.r + this.lineColorShift.r), Math.min(1, c.g + this.lineColorShift.g), Math.min(1, c.b + this.lineColorShift.b));
  997. }
  998. this.lineGeo = new three_examples_jsm_lines_LineGeometry__WEBPACK_IMPORTED_MODULE_2__.LineGeometry();
  999. this.lineGeo.setPositions(positions);
  1000. this.lineGeo.setColors(colors);
  1001. if (this.line) {
  1002. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.currentScene.remove(this.line);
  1003. }
  1004. this.line = new three_examples_jsm_lines_Line2__WEBPACK_IMPORTED_MODULE_4__.Line2(this.lineGeo, this.lineMat);
  1005. this.line.scale.set(1, 1, 1);
  1006. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.currentScene.add(this.line);
  1007. this.line.computeLineDistances();
  1008. }
  1009. addPoint(position, color) {
  1010. let dupePosition = position.clone();
  1011. dupePosition.y -= 4;
  1012. dupePosition.z += 0.1;
  1013. this.linePoints.push(dupePosition);
  1014. this.colors.push(color);
  1015. this.updateGeometry();
  1016. }
  1017. recomputePath(tileComponents) {
  1018. this.clearPoints();
  1019. tileComponents.forEach((tileComponent, index) => {
  1020. this.addPoint(tileComponent.object3d.position, tileComponent.object3d.originalMaterial.color);
  1021. });
  1022. this.updateGeometry();
  1023. }
  1024. clearPoints() {
  1025. this.linePoints.length = 0;
  1026. this.colors.length = 0;
  1027. if (this.line) {
  1028. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.currentScene.remove(this.line);
  1029. }
  1030. }
  1031. update() {
  1032. }
  1033. }
  1034. __name(Pathway, "Pathway");
  1035. __decorateClass([
  1036. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.props.color()
  1037. ], Pathway.prototype, "lineColorShift", 2);
  1038. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(Pathway);
  1039. /***/ }),
  1040. /***/ "./Assets/Components/RaycastReceiver.re.js":
  1041. /*!*************************************************!*\
  1042. !*** ./Assets/Components/RaycastReceiver.re.js ***!
  1043. \*************************************************/
  1044. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1045. __webpack_require__.r(__webpack_exports__);
  1046. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1047. /* harmony export */ "default": () => (/* binding */ RaycastReceiver)
  1048. /* harmony export */ });
  1049. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  1050. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  1051. var __defProp = Object.defineProperty;
  1052. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  1053. class RaycastReceiver extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
  1054. onMouseOver(intersect) {
  1055. throw new Error("Abstract class: Please inherit from this class to use it's behavior");
  1056. }
  1057. onMouseOut() {
  1058. throw new Error("Abstract class: Please inherit from this class to use it's behavior");
  1059. }
  1060. }
  1061. __name(RaycastReceiver, "RaycastReceiver");
  1062. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(RaycastReceiver);
  1063. /***/ }),
  1064. /***/ "./Assets/Components/RaycastReporter.re.js":
  1065. /*!*************************************************!*\
  1066. !*** ./Assets/Components/RaycastReporter.re.js ***!
  1067. \*************************************************/
  1068. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1069. __webpack_require__.r(__webpack_exports__);
  1070. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1071. /* harmony export */ "default": () => (/* binding */ RaycastReporter)
  1072. /* harmony export */ });
  1073. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  1074. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  1075. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ "three");
  1076. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__);
  1077. /* harmony import */ var _RaycastReceiver_re__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RaycastReceiver.re */ "./Assets/Components/RaycastReceiver.re.js");
  1078. var __defProp = Object.defineProperty;
  1079. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  1080. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  1081. var __decorateClass = (decorators, target, key, kind) => {
  1082. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  1083. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  1084. if (decorator = decorators[i])
  1085. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  1086. if (kind && result)
  1087. __defProp(target, key, result);
  1088. return result;
  1089. };
  1090. class RaycastReporter extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
  1091. constructor() {
  1092. super(...arguments);
  1093. this.receiverClass = ["RaycastReceiver"];
  1094. this.allHovered = [];
  1095. }
  1096. awake() {
  1097. }
  1098. start() {
  1099. this.mouse = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2(0, 0);
  1100. this.raycaster = new three__WEBPACK_IMPORTED_MODULE_1__.Raycaster();
  1101. this.updated = false;
  1102. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.touch.enabled = true;
  1103. }
  1104. normalizeScreenInput(browserVector, gameVector) {
  1105. const bounds = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.getBoundingClientRect();
  1106. gameVector.x = (browserVector.x - bounds.left) / bounds.width * 2 - 1;
  1107. gameVector.y = -((browserVector.y - bounds.top) / bounds.height) * 2 + 1;
  1108. }
  1109. getMouseInput() {
  1110. if (!rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse.isMoving) {
  1111. return;
  1112. }
  1113. this.normalizeScreenInput(rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse, this.mouse);
  1114. this.updated = true;
  1115. }
  1116. getTouchInput() {
  1117. if (rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.touch.touches.length == 0) {
  1118. return;
  1119. }
  1120. this.normalizeScreenInput(rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.touch.touches[0], this.mouse);
  1121. this.updated = true;
  1122. }
  1123. update() {
  1124. this.updated = false;
  1125. this.getMouseInput();
  1126. this.getTouchInput();
  1127. if (!this.updated) {
  1128. return;
  1129. }
  1130. this.raycaster.setFromCamera(this.mouse, this.object3d);
  1131. let intersects = this.raycaster.intersectObjects(rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.currentScene.children);
  1132. let listeningComponents = [];
  1133. intersects.forEach((intersect) => {
  1134. let object3d = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.currentScene.getObjectByProperty("uuid", intersect.object.uuid);
  1135. let component = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.getComponent(_RaycastReceiver_re__WEBPACK_IMPORTED_MODULE_2__["default"], object3d);
  1136. while (component == null && object3d.parent != null) {
  1137. object3d = object3d.parent;
  1138. component = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.getComponent(_RaycastReceiver_re__WEBPACK_IMPORTED_MODULE_2__["default"], object3d);
  1139. }
  1140. if (component != null) {
  1141. listeningComponents = listeningComponents.filter((dataThing) => {
  1142. dataThing.component.object3d.uuid != component.object3d.uuid;
  1143. });
  1144. listeningComponents.push({ component, intersect });
  1145. }
  1146. });
  1147. for (let i = 0; i < this.allHovered.length; i++) {
  1148. let dataThing = this.allHovered[i];
  1149. if (!listeningComponents.includes(dataThing)) {
  1150. dataThing.component.onMouseOut();
  1151. }
  1152. }
  1153. this.allHovered = [];
  1154. for (let i = 0; i < listeningComponents.length; i++) {
  1155. let dataThing = listeningComponents[i];
  1156. this.allHovered.push(dataThing);
  1157. if (dataThing.component.onMouseOver(dataThing.intersect) === false) {
  1158. break;
  1159. }
  1160. }
  1161. }
  1162. }
  1163. __name(RaycastReporter, "RaycastReporter");
  1164. __decorateClass([
  1165. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.PropList("String")
  1166. ], RaycastReporter.prototype, "receiverClass", 2);
  1167. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(RaycastReporter);
  1168. /***/ }),
  1169. /***/ "./Assets/Components/SceneLinkRaycastReceiver.re.js":
  1170. /*!**********************************************************!*\
  1171. !*** ./Assets/Components/SceneLinkRaycastReceiver.re.js ***!
  1172. \**********************************************************/
  1173. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1174. __webpack_require__.r(__webpack_exports__);
  1175. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1176. /* harmony export */ "default": () => (/* binding */ SceneLinkRaycastReceiver)
  1177. /* harmony export */ });
  1178. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  1179. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  1180. /* harmony import */ var _RaycastReceiver_re__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RaycastReceiver.re */ "./Assets/Components/RaycastReceiver.re.js");
  1181. var __defProp = Object.defineProperty;
  1182. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  1183. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  1184. var __decorateClass = (decorators, target, key, kind) => {
  1185. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  1186. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  1187. if (decorator = decorators[i])
  1188. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  1189. if (kind && result)
  1190. __defProp(target, key, result);
  1191. return result;
  1192. };
  1193. class SceneLinkRaycastReceiver extends _RaycastReceiver_re__WEBPACK_IMPORTED_MODULE_1__["default"] {
  1194. awake() {
  1195. }
  1196. start() {
  1197. }
  1198. update() {
  1199. if (this.isHovered && (rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse.getButtonUp(0) || rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.touch.endTouches.length > 0)) {
  1200. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.style.cursor = "default";
  1201. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.loadScene(this.targetScene);
  1202. }
  1203. }
  1204. onMouseOver(intersect) {
  1205. this.isHovered = true;
  1206. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.style.cursor = "pointer";
  1207. }
  1208. onMouseOut() {
  1209. this.isHovered = false;
  1210. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.style.cursor = "default";
  1211. }
  1212. }
  1213. __name(SceneLinkRaycastReceiver, "SceneLinkRaycastReceiver");
  1214. __decorateClass([
  1215. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("String")
  1216. ], SceneLinkRaycastReceiver.prototype, "targetScene", 2);
  1217. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(SceneLinkRaycastReceiver);
  1218. /***/ }),
  1219. /***/ "./Assets/Components/ScrollObject.re.js":
  1220. /*!**********************************************!*\
  1221. !*** ./Assets/Components/ScrollObject.re.js ***!
  1222. \**********************************************/
  1223. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1224. __webpack_require__.r(__webpack_exports__);
  1225. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1226. /* harmony export */ "default": () => (/* binding */ ScrollObject)
  1227. /* harmony export */ });
  1228. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  1229. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  1230. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ "three");
  1231. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__);
  1232. var __defProp = Object.defineProperty;
  1233. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  1234. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  1235. var __decorateClass = (decorators, target, key, kind) => {
  1236. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  1237. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  1238. if (decorator = decorators[i])
  1239. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  1240. if (kind && result)
  1241. __defProp(target, key, result);
  1242. return result;
  1243. };
  1244. class ScrollObject extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
  1245. constructor() {
  1246. super(...arguments);
  1247. this.offsetPerTick = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0.01, 0);
  1248. this.completedBound = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 10, 0);
  1249. this.nextScene = "Title Screen";
  1250. }
  1251. awake() {
  1252. }
  1253. start() {
  1254. }
  1255. update() {
  1256. this.object3d.position.add(this.offsetPerTick);
  1257. if (this.object3d.position.x >= this.completedBound.x && this.object3d.position.y >= this.completedBound.y && this.object3d.position.z >= this.completedBound.z) {
  1258. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.loadScene(this.nextScene);
  1259. }
  1260. }
  1261. }
  1262. __name(ScrollObject, "ScrollObject");
  1263. __decorateClass([
  1264. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector3")
  1265. ], ScrollObject.prototype, "offsetPerTick", 2);
  1266. __decorateClass([
  1267. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector3")
  1268. ], ScrollObject.prototype, "completedBound", 2);
  1269. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(ScrollObject);
  1270. /***/ }),
  1271. /***/ "./Assets/Components/ScrollTexture.re.js":
  1272. /*!***********************************************!*\
  1273. !*** ./Assets/Components/ScrollTexture.re.js ***!
  1274. \***********************************************/
  1275. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1276. __webpack_require__.r(__webpack_exports__);
  1277. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1278. /* harmony export */ "default": () => (/* binding */ ScrollTexture)
  1279. /* harmony export */ });
  1280. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  1281. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  1282. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ "three");
  1283. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__);
  1284. var __defProp = Object.defineProperty;
  1285. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  1286. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  1287. var __decorateClass = (decorators, target, key, kind) => {
  1288. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  1289. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  1290. if (decorator = decorators[i])
  1291. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  1292. if (kind && result)
  1293. __defProp(target, key, result);
  1294. return result;
  1295. };
  1296. class ScrollTexture extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
  1297. constructor() {
  1298. super(...arguments);
  1299. this.offsetPerTick = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2(-1e-3, 1e-3);
  1300. }
  1301. update() {
  1302. this.materialToOffset.map.offset.add(this.offsetPerTick);
  1303. }
  1304. }
  1305. __name(ScrollTexture, "ScrollTexture");
  1306. __decorateClass([
  1307. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector2")
  1308. ], ScrollTexture.prototype, "offsetPerTick", 2);
  1309. __decorateClass([
  1310. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Material")
  1311. ], ScrollTexture.prototype, "materialToOffset", 2);
  1312. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(ScrollTexture);
  1313. /***/ }),
  1314. /***/ "./Assets/Components/TileRaycastReceiver.re.js":
  1315. /*!*****************************************************!*\
  1316. !*** ./Assets/Components/TileRaycastReceiver.re.js ***!
  1317. \*****************************************************/
  1318. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1319. __webpack_require__.r(__webpack_exports__);
  1320. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1321. /* harmony export */ "default": () => (/* binding */ TileRaycastReceiver)
  1322. /* harmony export */ });
  1323. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  1324. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  1325. /* harmony import */ var _RaycastReceiver_re__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RaycastReceiver.re */ "./Assets/Components/RaycastReceiver.re.js");
  1326. /* harmony import */ var _Library_SimpleTweens__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Library/SimpleTweens */ "./Assets/Components/Library/SimpleTweens.js");
  1327. /* harmony import */ var _Library_Easings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Library/Easings */ "./Assets/Components/Library/Easings.js");
  1328. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ "three");
  1329. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_4__);
  1330. /* harmony import */ var _CombatLogic_re__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CombatLogic.re */ "./Assets/Components/CombatLogic.re.js");
  1331. var __defProp = Object.defineProperty;
  1332. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  1333. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  1334. var __decorateClass = (decorators, target, key, kind) => {
  1335. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  1336. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  1337. if (decorator = decorators[i])
  1338. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  1339. if (kind && result)
  1340. __defProp(target, key, result);
  1341. return result;
  1342. };
  1343. class TileRaycastReceiver extends _RaycastReceiver_re__WEBPACK_IMPORTED_MODULE_1__["default"] {
  1344. constructor() {
  1345. super(...arguments);
  1346. this.tileSize = new three__WEBPACK_IMPORTED_MODULE_4__.Vector2(1.1, 1.1);
  1347. }
  1348. onMouseOver(intersect) {
  1349. if (this.object3d.isAnimating) {
  1350. return;
  1351. }
  1352. this.currentObj = intersect.object;
  1353. this.currentObj.material = this.currentObj.highlightMaterial;
  1354. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.style.cursor = "pointer";
  1355. if (rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse.getButtonPressed(0) || rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.touch.touches.length == 1) {
  1356. let game = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.getComponent(_CombatLogic_re__WEBPACK_IMPORTED_MODULE_5__["default"]);
  1357. let [isAdded, selectedTiles] = game.addTile(this);
  1358. if (isAdded) {
  1359. if (this.hoverSound) {
  1360. this.hoverSound.play();
  1361. }
  1362. } else {
  1363. if (selectedTiles[selectedTiles.length - 1] != this) {
  1364. this.currentObj.material = this.currentObj.originalMaterial;
  1365. }
  1366. }
  1367. }
  1368. }
  1369. onMouseOut() {
  1370. if (this.object3d.isAnimating || !this.currentObj) {
  1371. return;
  1372. }
  1373. if (rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Input.mouse.getButtonPressed(0)) {
  1374. }
  1375. this.currentObj.material = this.currentObj.originalMaterial;
  1376. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.rogueDOMContainer.style.cursor = "default";
  1377. }
  1378. getOriginalMaterial() {
  1379. return this.object3d.originalMaterial;
  1380. }
  1381. getPosition() {
  1382. return this.object3d.position;
  1383. }
  1384. awake() {
  1385. }
  1386. start() {
  1387. if (this.dropInSound) {
  1388. this.dropInSound.setVolume(0.7);
  1389. this.dropInSound.setLoop(false);
  1390. }
  1391. if (this.hoverSound) {
  1392. this.hoverSound.setVolume(0.7);
  1393. this.hoverSound.setLoop(false);
  1394. }
  1395. if (this.clearSound) {
  1396. this.clearSound.setVolume(1);
  1397. this.clearSound.setLoop(false);
  1398. }
  1399. }
  1400. update() {
  1401. }
  1402. initialize(gridPosition, boardDimensions, originalMaterial, hoverMaterial, tweenManager, delay, startingZ, easingFunction) {
  1403. let offset = new three__WEBPACK_IMPORTED_MODULE_4__.Vector2((boardDimensions.x * this.tileSize.x - 1) / 2, (boardDimensions.y * this.tileSize.y - 1) / 2);
  1404. let actualPosition = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(this.tileSize.x * gridPosition.x - offset.x, this.tileSize.y * gridPosition.y - offset.y, startingZ);
  1405. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Debug.log(JSON.stringify(actualPosition));
  1406. this.object3d.position.copy(actualPosition);
  1407. this.object3d.originalMaterial = originalMaterial;
  1408. this.object3d.highlightMaterial = hoverMaterial;
  1409. this.object3d.material = originalMaterial;
  1410. this.object3d.gridPosition = gridPosition;
  1411. this.object3d.isAnimating = true;
  1412. setTimeout(() => {
  1413. if (this.dropInSound) {
  1414. this.dropInSound.play();
  1415. }
  1416. }, delay / 3 * Math.random());
  1417. tweenManager.add(new _Library_SimpleTweens__WEBPACK_IMPORTED_MODULE_2__.SimpleTween(this.object3d.position, { z: 0 }, delay, easingFunction, () => {
  1418. this.object3d.isAnimating = false;
  1419. }));
  1420. }
  1421. remove(tweenManager) {
  1422. this.object3d.isAnimating = true;
  1423. setTimeout(() => {
  1424. if (this.clearSound) {
  1425. this.clearSound.play();
  1426. }
  1427. }, 150 * Math.random());
  1428. tweenManager.add(new _Library_SimpleTweens__WEBPACK_IMPORTED_MODULE_2__.SimpleTween(this.object3d.position, { z: -14 }, Math.floor(1500 * Math.random()) + 300, _Library_Easings__WEBPACK_IMPORTED_MODULE_3__["default"].Quadratic.EaseIn, () => {
  1429. this.object3d.parent.remove(this.object3d);
  1430. }));
  1431. }
  1432. }
  1433. __name(TileRaycastReceiver, "TileRaycastReceiver");
  1434. __decorateClass([
  1435. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Vector2")
  1436. ], TileRaycastReceiver.prototype, "tileSize", 2);
  1437. __decorateClass([
  1438. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Audio")
  1439. ], TileRaycastReceiver.prototype, "dropInSound", 2);
  1440. __decorateClass([
  1441. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Audio")
  1442. ], TileRaycastReceiver.prototype, "hoverSound", 2);
  1443. __decorateClass([
  1444. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Prop("Audio")
  1445. ], TileRaycastReceiver.prototype, "clearSound", 2);
  1446. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(TileRaycastReceiver);
  1447. /***/ }),
  1448. /***/ "./Assets/Components/TitleScreenControl.re.js":
  1449. /*!****************************************************!*\
  1450. !*** ./Assets/Components/TitleScreenControl.re.js ***!
  1451. \****************************************************/
  1452. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1453. __webpack_require__.r(__webpack_exports__);
  1454. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1455. /* harmony export */ "default": () => (/* binding */ TitleScreenControl)
  1456. /* harmony export */ });
  1457. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
  1458. /* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
  1459. /* harmony import */ var _Library_AsyncLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Library/AsyncLoader */ "./Assets/Components/Library/AsyncLoader.js");
  1460. var __defProp = Object.defineProperty;
  1461. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  1462. var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  1463. var __decorateClass = (decorators, target, key, kind) => {
  1464. var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  1465. for (var i = decorators.length - 1, decorator; i >= 0; i--)
  1466. if (decorator = decorators[i])
  1467. result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  1468. if (kind && result)
  1469. __defProp(target, key, result);
  1470. return result;
  1471. };
  1472. class TitleScreenControl extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
  1473. constructor() {
  1474. super(...arguments);
  1475. this.introScene = "Combat Screen";
  1476. this.creditsScene = "Credits";
  1477. this.loader = new _Library_AsyncLoader__WEBPACK_IMPORTED_MODULE_1__["default"]();
  1478. }
  1479. awake() {
  1480. }
  1481. start() {
  1482. this.loader.loadStaticText("title-screen.html").then((html) => {
  1483. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Runtime.uiContainer.innerHTML = html;
  1484. document.getElementById("play-button").addEventListener("mouseup", () => {
  1485. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.loadScene(this.introScene);
  1486. });
  1487. document.getElementById("play-button").addEventListener("touchend", () => {
  1488. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.loadScene(this.introScene);
  1489. });
  1490. document.getElementById("credits-button").addEventListener("mouseup", () => {
  1491. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.loadScene(this.creditsScene);
  1492. });
  1493. document.getElementById("credits-button").addEventListener("touchend", () => {
  1494. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.loadScene(this.creditsScene);
  1495. });
  1496. });
  1497. }
  1498. update() {
  1499. }
  1500. }
  1501. __name(TitleScreenControl, "TitleScreenControl");
  1502. __decorateClass([
  1503. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.props.text()
  1504. ], TitleScreenControl.prototype, "introScene", 2);
  1505. __decorateClass([
  1506. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.props.text()
  1507. ], TitleScreenControl.prototype, "creditsScene", 2);
  1508. rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(TitleScreenControl);
  1509. /***/ }),
  1510. /***/ "rogue-engine":
  1511. /*!******************************************************************************************************************!*\
  1512. !*** external {"commonjs":"rogue-engine","commonjs2":"rogue-engine","amd":"rogue-engine","root":"rogue-engine"} ***!
  1513. \******************************************************************************************************************/
  1514. /***/ ((module) => {
  1515. module.exports = __WEBPACK_EXTERNAL_MODULE_rogue_engine__;
  1516. /***/ }),
  1517. /***/ "three":
  1518. /*!**************************************************************************************!*\
  1519. !*** external {"commonjs":"three","commonjs2":"three","amd":"three","root":"three"} ***!
  1520. \**************************************************************************************/
  1521. /***/ ((module) => {
  1522. module.exports = __WEBPACK_EXTERNAL_MODULE_three__;
  1523. /***/ }),
  1524. /***/ "./node_modules/three/examples/jsm/lines/Line2.js":
  1525. /*!********************************************************!*\
  1526. !*** ./node_modules/three/examples/jsm/lines/Line2.js ***!
  1527. \********************************************************/
  1528. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  1529. __webpack_require__.r(__webpack_exports__);
  1530. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1531. /* harmony export */ "Line2": () => (/* binding */ Line2)
  1532. /* harmony export */ });
  1533. /* harmony import */ var _lines_LineSegments2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lines/LineSegments2.js */ "./node_modules/three/examples/jsm/lines/LineSegments2.js");
  1534. /* harmony import */ var _lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lines/LineGeometry.js */ "./node_modules/three/examples/jsm/lines/LineGeometry.js");
  1535. /* harmony import */ var _lines_LineMaterial_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lines/LineMaterial.js */ "./node_modules/three/examples/jsm/lines/LineMaterial.js");
  1536. class Line2 extends _lines_LineSegments2_js__WEBPACK_IMPORTED_MODULE_0__.LineSegments2 {
  1537. constructor( geometry = new _lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_1__.LineGeometry(), material = new _lines_LineMaterial_js__WEBPACK_IMPORTED_MODULE_2__.LineMaterial( { color: Math.random() * 0xffffff } ) ) {
  1538. super( geometry, material );
  1539. this.type = 'Line2';
  1540. }
  1541. }
  1542. Line2.prototype.isLine2 = true;
  1543. /***/ }),
  1544. /***/ "./node_modules/three/examples/jsm/lines/LineGeometry.js":
  1545. /*!***************************************************************!*\
  1546. !*** ./node_modules/three/examples/jsm/lines/LineGeometry.js ***!
  1547. \***************************************************************/
  1548. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  1549. __webpack_require__.r(__webpack_exports__);
  1550. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1551. /* harmony export */ "LineGeometry": () => (/* binding */ LineGeometry)
  1552. /* harmony export */ });
  1553. /* harmony import */ var _lines_LineSegmentsGeometry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lines/LineSegmentsGeometry.js */ "./node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js");
  1554. class LineGeometry extends _lines_LineSegmentsGeometry_js__WEBPACK_IMPORTED_MODULE_0__.LineSegmentsGeometry {
  1555. constructor() {
  1556. super();
  1557. this.type = 'LineGeometry';
  1558. }
  1559. setPositions( array ) {
  1560. // converts [ x1, y1, z1, x2, y2, z2, ... ] to pairs format
  1561. var length = array.length - 3;
  1562. var points = new Float32Array( 2 * length );
  1563. for ( var i = 0; i < length; i += 3 ) {
  1564. points[ 2 * i ] = array[ i ];
  1565. points[ 2 * i + 1 ] = array[ i + 1 ];
  1566. points[ 2 * i + 2 ] = array[ i + 2 ];
  1567. points[ 2 * i + 3 ] = array[ i + 3 ];
  1568. points[ 2 * i + 4 ] = array[ i + 4 ];
  1569. points[ 2 * i + 5 ] = array[ i + 5 ];
  1570. }
  1571. super.setPositions( points );
  1572. return this;
  1573. }
  1574. setColors( array ) {
  1575. // converts [ r1, g1, b1, r2, g2, b2, ... ] to pairs format
  1576. var length = array.length - 3;
  1577. var colors = new Float32Array( 2 * length );
  1578. for ( var i = 0; i < length; i += 3 ) {
  1579. colors[ 2 * i ] = array[ i ];
  1580. colors[ 2 * i + 1 ] = array[ i + 1 ];
  1581. colors[ 2 * i + 2 ] = array[ i + 2 ];
  1582. colors[ 2 * i + 3 ] = array[ i + 3 ];
  1583. colors[ 2 * i + 4 ] = array[ i + 4 ];
  1584. colors[ 2 * i + 5 ] = array[ i + 5 ];
  1585. }
  1586. super.setColors( colors );
  1587. return this;
  1588. }
  1589. fromLine( line ) {
  1590. var geometry = line.geometry;
  1591. if ( geometry.isGeometry ) {
  1592. console.error( 'THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.' );
  1593. return;
  1594. } else if ( geometry.isBufferGeometry ) {
  1595. this.setPositions( geometry.attributes.position.array ); // assumes non-indexed
  1596. }
  1597. // set colors, maybe
  1598. return this;
  1599. }
  1600. }
  1601. LineGeometry.prototype.isLineGeometry = true;
  1602. /***/ }),
  1603. /***/ "./node_modules/three/examples/jsm/lines/LineMaterial.js":
  1604. /*!***************************************************************!*\
  1605. !*** ./node_modules/three/examples/jsm/lines/LineMaterial.js ***!
  1606. \***************************************************************/
  1607. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  1608. __webpack_require__.r(__webpack_exports__);
  1609. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1610. /* harmony export */ "LineMaterial": () => (/* binding */ LineMaterial)
  1611. /* harmony export */ });
  1612. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ "three");
  1613. /**
  1614. * parameters = {
  1615. * color: <hex>,
  1616. * linewidth: <float>,
  1617. * dashed: <boolean>,
  1618. * dashScale: <float>,
  1619. * dashSize: <float>,
  1620. * gapSize: <float>,
  1621. * resolution: <Vector2>, // to be set by renderer
  1622. * }
  1623. */
  1624. three__WEBPACK_IMPORTED_MODULE_0__.UniformsLib.line = {
  1625. worldUnits: { value: 1 },
  1626. linewidth: { value: 1 },
  1627. resolution: { value: new three__WEBPACK_IMPORTED_MODULE_0__.Vector2( 1, 1 ) },
  1628. dashScale: { value: 1 },
  1629. dashSize: { value: 1 },
  1630. gapSize: { value: 1 } // todo FIX - maybe change to totalSize
  1631. };
  1632. three__WEBPACK_IMPORTED_MODULE_0__.ShaderLib.line = {
  1633. uniforms: three__WEBPACK_IMPORTED_MODULE_0__.UniformsUtils.merge( [
  1634. three__WEBPACK_IMPORTED_MODULE_0__.UniformsLib.common,
  1635. three__WEBPACK_IMPORTED_MODULE_0__.UniformsLib.fog,
  1636. three__WEBPACK_IMPORTED_MODULE_0__.UniformsLib.line
  1637. ] ),
  1638. vertexShader:
  1639. /* glsl */`
  1640. #include <common>
  1641. #include <color_pars_vertex>
  1642. #include <fog_pars_vertex>
  1643. #include <logdepthbuf_pars_vertex>
  1644. #include <clipping_planes_pars_vertex>
  1645. uniform float linewidth;
  1646. uniform vec2 resolution;
  1647. attribute vec3 instanceStart;
  1648. attribute vec3 instanceEnd;
  1649. attribute vec3 instanceColorStart;
  1650. attribute vec3 instanceColorEnd;
  1651. #ifdef WORLD_UNITS
  1652. varying vec4 worldPos;
  1653. varying vec3 worldStart;
  1654. varying vec3 worldEnd;
  1655. #ifdef USE_DASH
  1656. varying vec2 vUv;
  1657. #endif
  1658. #else
  1659. varying vec2 vUv;
  1660. #endif
  1661. #ifdef USE_DASH
  1662. uniform float dashScale;
  1663. attribute float instanceDistanceStart;
  1664. attribute float instanceDistanceEnd;
  1665. varying float vLineDistance;
  1666. #endif
  1667. void trimSegment( const in vec4 start, inout vec4 end ) {
  1668. // trim end segment so it terminates between the camera plane and the near plane
  1669. // conservative estimate of the near plane
  1670. float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
  1671. float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
  1672. float nearEstimate = - 0.5 * b / a;
  1673. float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
  1674. end.xyz = mix( start.xyz, end.xyz, alpha );
  1675. }
  1676. void main() {
  1677. #ifdef USE_COLOR
  1678. vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
  1679. #endif
  1680. #ifdef USE_DASH
  1681. vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
  1682. vUv = uv;
  1683. #endif
  1684. float aspect = resolution.x / resolution.y;
  1685. // camera space
  1686. vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
  1687. vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
  1688. #ifdef WORLD_UNITS
  1689. worldStart = start.xyz;
  1690. worldEnd = end.xyz;
  1691. #else
  1692. vUv = uv;
  1693. #endif
  1694. // special case for perspective projection, and segments that terminate either in, or behind, the camera plane
  1695. // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
  1696. // but we need to perform ndc-space calculations in the shader, so we must address this issue directly
  1697. // perhaps there is a more elegant solution -- WestLangley
  1698. bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
  1699. if ( perspective ) {
  1700. if ( start.z < 0.0 && end.z >= 0.0 ) {
  1701. trimSegment( start, end );
  1702. } else if ( end.z < 0.0 && start.z >= 0.0 ) {
  1703. trimSegment( end, start );
  1704. }
  1705. }
  1706. // clip space
  1707. vec4 clipStart = projectionMatrix * start;
  1708. vec4 clipEnd = projectionMatrix * end;
  1709. // ndc space
  1710. vec3 ndcStart = clipStart.xyz / clipStart.w;
  1711. vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
  1712. // direction
  1713. vec2 dir = ndcEnd.xy - ndcStart.xy;
  1714. // account for clip-space aspect ratio
  1715. dir.x *= aspect;
  1716. dir = normalize( dir );
  1717. #ifdef WORLD_UNITS
  1718. // get the offset direction as perpendicular to the view vector
  1719. vec3 worldDir = normalize( end.xyz - start.xyz );
  1720. vec3 offset;
  1721. if ( position.y < 0.5 ) {
  1722. offset = normalize( cross( start.xyz, worldDir ) );
  1723. } else {
  1724. offset = normalize( cross( end.xyz, worldDir ) );
  1725. }
  1726. // sign flip
  1727. if ( position.x < 0.0 ) offset *= - 1.0;
  1728. float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );
  1729. // don't extend the line if we're rendering dashes because we
  1730. // won't be rendering the endcaps
  1731. #ifndef USE_DASH
  1732. // extend the line bounds to encompass endcaps
  1733. start.xyz += - worldDir * linewidth * 0.5;
  1734. end.xyz += worldDir * linewidth * 0.5;
  1735. // shift the position of the quad so it hugs the forward edge of the line
  1736. offset.xy -= dir * forwardOffset;
  1737. offset.z += 0.5;
  1738. #endif
  1739. // endcaps
  1740. if ( position.y > 1.0 || position.y < 0.0 ) {
  1741. offset.xy += dir * 2.0 * forwardOffset;
  1742. }
  1743. // adjust for linewidth
  1744. offset *= linewidth * 0.5;
  1745. // set the world position
  1746. worldPos = ( position.y < 0.5 ) ? start : end;
  1747. worldPos.xyz += offset;
  1748. // project the worldpos
  1749. vec4 clip = projectionMatrix * worldPos;
  1750. // shift the depth of the projected points so the line
  1751. // segements overlap neatly
  1752. vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
  1753. clip.z = clipPose.z * clip.w;
  1754. #else
  1755. vec2 offset = vec2( dir.y, - dir.x );
  1756. // undo aspect ratio adjustment
  1757. dir.x /= aspect;
  1758. offset.x /= aspect;
  1759. // sign flip
  1760. if ( position.x < 0.0 ) offset *= - 1.0;
  1761. // endcaps
  1762. if ( position.y < 0.0 ) {
  1763. offset += - dir;
  1764. } else if ( position.y > 1.0 ) {
  1765. offset += dir;
  1766. }
  1767. // adjust for linewidth
  1768. offset *= linewidth;
  1769. // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
  1770. offset /= resolution.y;
  1771. // select end
  1772. vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
  1773. // back to clip space
  1774. offset *= clip.w;
  1775. clip.xy += offset;
  1776. #endif
  1777. gl_Position = clip;
  1778. vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
  1779. #include <logdepthbuf_vertex>
  1780. #include <clipping_planes_vertex>
  1781. #include <fog_vertex>
  1782. }
  1783. `,
  1784. fragmentShader:
  1785. /* glsl */`
  1786. uniform vec3 diffuse;
  1787. uniform float opacity;
  1788. uniform float linewidth;
  1789. #ifdef USE_DASH
  1790. uniform float dashSize;
  1791. uniform float gapSize;
  1792. #endif
  1793. varying float vLineDistance;
  1794. #ifdef WORLD_UNITS
  1795. varying vec4 worldPos;
  1796. varying vec3 worldStart;
  1797. varying vec3 worldEnd;
  1798. #ifdef USE_DASH
  1799. varying vec2 vUv;
  1800. #endif
  1801. #else
  1802. varying vec2 vUv;
  1803. #endif
  1804. #include <common>
  1805. #include <color_pars_fragment>
  1806. #include <fog_pars_fragment>
  1807. #include <logdepthbuf_pars_fragment>
  1808. #include <clipping_planes_pars_fragment>
  1809. vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
  1810. float mua;
  1811. float mub;
  1812. vec3 p13 = p1 - p3;
  1813. vec3 p43 = p4 - p3;
  1814. vec3 p21 = p2 - p1;
  1815. float d1343 = dot( p13, p43 );
  1816. float d4321 = dot( p43, p21 );
  1817. float d1321 = dot( p13, p21 );
  1818. float d4343 = dot( p43, p43 );
  1819. float d2121 = dot( p21, p21 );
  1820. float denom = d2121 * d4343 - d4321 * d4321;
  1821. float numer = d1343 * d4321 - d1321 * d4343;
  1822. mua = numer / denom;
  1823. mua = clamp( mua, 0.0, 1.0 );
  1824. mub = ( d1343 + d4321 * ( mua ) ) / d4343;
  1825. mub = clamp( mub, 0.0, 1.0 );
  1826. return vec2( mua, mub );
  1827. }
  1828. void main() {
  1829. #include <clipping_planes_fragment>
  1830. #ifdef USE_DASH
  1831. if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
  1832. if ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
  1833. #endif
  1834. float alpha = opacity;
  1835. #ifdef WORLD_UNITS
  1836. // Find the closest points on the view ray and the line segment
  1837. vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
  1838. vec3 lineDir = worldEnd - worldStart;
  1839. vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
  1840. vec3 p1 = worldStart + lineDir * params.x;
  1841. vec3 p2 = rayEnd * params.y;
  1842. vec3 delta = p1 - p2;
  1843. float len = length( delta );
  1844. float norm = len / linewidth;
  1845. #ifndef USE_DASH
  1846. #ifdef USE_ALPHA_TO_COVERAGE
  1847. float dnorm = fwidth( norm );
  1848. alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
  1849. #else
  1850. if ( norm > 0.5 ) {
  1851. discard;
  1852. }
  1853. #endif
  1854. #endif
  1855. #else
  1856. #ifdef USE_ALPHA_TO_COVERAGE
  1857. // artifacts appear on some hardware if a derivative is taken within a conditional
  1858. float a = vUv.x;
  1859. float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
  1860. float len2 = a * a + b * b;
  1861. float dlen = fwidth( len2 );
  1862. if ( abs( vUv.y ) > 1.0 ) {
  1863. alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
  1864. }
  1865. #else
  1866. if ( abs( vUv.y ) > 1.0 ) {
  1867. float a = vUv.x;
  1868. float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
  1869. float len2 = a * a + b * b;
  1870. if ( len2 > 1.0 ) discard;
  1871. }
  1872. #endif
  1873. #endif
  1874. vec4 diffuseColor = vec4( diffuse, alpha );
  1875. #include <logdepthbuf_fragment>
  1876. #include <color_fragment>
  1877. gl_FragColor = vec4( diffuseColor.rgb, alpha );
  1878. #include <tonemapping_fragment>
  1879. #include <encodings_fragment>
  1880. #include <fog_fragment>
  1881. #include <premultiplied_alpha_fragment>
  1882. }
  1883. `
  1884. };
  1885. class LineMaterial extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial {
  1886. constructor( parameters ) {
  1887. super( {
  1888. type: 'LineMaterial',
  1889. uniforms: three__WEBPACK_IMPORTED_MODULE_0__.UniformsUtils.clone( three__WEBPACK_IMPORTED_MODULE_0__.ShaderLib.line.uniforms ),
  1890. vertexShader: three__WEBPACK_IMPORTED_MODULE_0__.ShaderLib.line.vertexShader,
  1891. fragmentShader: three__WEBPACK_IMPORTED_MODULE_0__.ShaderLib.line.fragmentShader,
  1892. clipping: true // required for clipping support
  1893. } );
  1894. Object.defineProperties( this, {
  1895. color: {
  1896. enumerable: true,
  1897. get: function () {
  1898. return this.uniforms.diffuse.value;
  1899. },
  1900. set: function ( value ) {
  1901. this.uniforms.diffuse.value = value;
  1902. }
  1903. },
  1904. worldUnits: {
  1905. enumerable: true,
  1906. get: function () {
  1907. return 'WORLD_UNITS' in this.defines;
  1908. },
  1909. set: function ( value ) {
  1910. if ( value === true ) {
  1911. this.defines.WORLD_UNITS = '';
  1912. } else {
  1913. delete this.defines.WORLD_UNITS;
  1914. }
  1915. }
  1916. },
  1917. linewidth: {
  1918. enumerable: true,
  1919. get: function () {
  1920. return this.uniforms.linewidth.value;
  1921. },
  1922. set: function ( value ) {
  1923. this.uniforms.linewidth.value = value;
  1924. }
  1925. },
  1926. dashed: {
  1927. enumerable: true,
  1928. get: function () {
  1929. return Boolean( 'USE_DASH' in this.defines );
  1930. },
  1931. set( value ) {
  1932. if ( Boolean( value ) !== Boolean( 'USE_DASH' in this.defines ) ) {
  1933. this.needsUpdate = true;
  1934. }
  1935. if ( value === true ) {
  1936. this.defines.USE_DASH = '';
  1937. } else {
  1938. delete this.defines.USE_DASH;
  1939. }
  1940. }
  1941. },
  1942. dashScale: {
  1943. enumerable: true,
  1944. get: function () {
  1945. return this.uniforms.dashScale.value;
  1946. },
  1947. set: function ( value ) {
  1948. this.uniforms.dashScale.value = value;
  1949. }
  1950. },
  1951. dashSize: {
  1952. enumerable: true,
  1953. get: function () {
  1954. return this.uniforms.dashSize.value;
  1955. },
  1956. set: function ( value ) {
  1957. this.uniforms.dashSize.value = value;
  1958. }
  1959. },
  1960. dashOffset: {
  1961. enumerable: true,
  1962. get: function () {
  1963. return this.uniforms.dashOffset.value;
  1964. },
  1965. set: function ( value ) {
  1966. this.uniforms.dashOffset.value = value;
  1967. }
  1968. },
  1969. gapSize: {
  1970. enumerable: true,
  1971. get: function () {
  1972. return this.uniforms.gapSize.value;
  1973. },
  1974. set: function ( value ) {
  1975. this.uniforms.gapSize.value = value;
  1976. }
  1977. },
  1978. opacity: {
  1979. enumerable: true,
  1980. get: function () {
  1981. return this.uniforms.opacity.value;
  1982. },
  1983. set: function ( value ) {
  1984. this.uniforms.opacity.value = value;
  1985. }
  1986. },
  1987. resolution: {
  1988. enumerable: true,
  1989. get: function () {
  1990. return this.uniforms.resolution.value;
  1991. },
  1992. set: function ( value ) {
  1993. this.uniforms.resolution.value.copy( value );
  1994. }
  1995. },
  1996. alphaToCoverage: {
  1997. enumerable: true,
  1998. get: function () {
  1999. return Boolean( 'USE_ALPHA_TO_COVERAGE' in this.defines );
  2000. },
  2001. set: function ( value ) {
  2002. if ( Boolean( value ) !== Boolean( 'USE_ALPHA_TO_COVERAGE' in this.defines ) ) {
  2003. this.needsUpdate = true;
  2004. }
  2005. if ( value === true ) {
  2006. this.defines.USE_ALPHA_TO_COVERAGE = '';
  2007. this.extensions.derivatives = true;
  2008. } else {
  2009. delete this.defines.USE_ALPHA_TO_COVERAGE;
  2010. this.extensions.derivatives = false;
  2011. }
  2012. }
  2013. }
  2014. } );
  2015. this.setValues( parameters );
  2016. }
  2017. }
  2018. LineMaterial.prototype.isLineMaterial = true;
  2019. /***/ }),
  2020. /***/ "./node_modules/three/examples/jsm/lines/LineSegments2.js":
  2021. /*!****************************************************************!*\
  2022. !*** ./node_modules/three/examples/jsm/lines/LineSegments2.js ***!
  2023. \****************************************************************/
  2024. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  2025. __webpack_require__.r(__webpack_exports__);
  2026. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2027. /* harmony export */ "LineSegments2": () => (/* binding */ LineSegments2)
  2028. /* harmony export */ });
  2029. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ "three");
  2030. /* harmony import */ var _lines_LineSegmentsGeometry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lines/LineSegmentsGeometry.js */ "./node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js");
  2031. /* harmony import */ var _lines_LineMaterial_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lines/LineMaterial.js */ "./node_modules/three/examples/jsm/lines/LineMaterial.js");
  2032. const _start = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();
  2033. const _end = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();
  2034. const _start4 = new three__WEBPACK_IMPORTED_MODULE_0__.Vector4();
  2035. const _end4 = new three__WEBPACK_IMPORTED_MODULE_0__.Vector4();
  2036. const _ssOrigin = new three__WEBPACK_IMPORTED_MODULE_0__.Vector4();
  2037. const _ssOrigin3 = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();
  2038. const _mvMatrix = new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4();
  2039. const _line = new three__WEBPACK_IMPORTED_MODULE_0__.Line3();
  2040. const _closestPoint = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();
  2041. const _box = new three__WEBPACK_IMPORTED_MODULE_0__.Box3();
  2042. const _sphere = new three__WEBPACK_IMPORTED_MODULE_0__.Sphere();
  2043. const _clipToWorldVector = new three__WEBPACK_IMPORTED_MODULE_0__.Vector4();
  2044. class LineSegments2 extends three__WEBPACK_IMPORTED_MODULE_0__.Mesh {
  2045. constructor( geometry = new _lines_LineSegmentsGeometry_js__WEBPACK_IMPORTED_MODULE_1__.LineSegmentsGeometry(), material = new _lines_LineMaterial_js__WEBPACK_IMPORTED_MODULE_2__.LineMaterial( { color: Math.random() * 0xffffff } ) ) {
  2046. super( geometry, material );
  2047. this.type = 'LineSegments2';
  2048. }
  2049. // for backwards-compatability, but could be a method of LineSegmentsGeometry...
  2050. computeLineDistances() {
  2051. const geometry = this.geometry;
  2052. const instanceStart = geometry.attributes.instanceStart;
  2053. const instanceEnd = geometry.attributes.instanceEnd;
  2054. const lineDistances = new Float32Array( 2 * instanceStart.count );
  2055. for ( let i = 0, j = 0, l = instanceStart.count; i < l; i ++, j += 2 ) {
  2056. _start.fromBufferAttribute( instanceStart, i );
  2057. _end.fromBufferAttribute( instanceEnd, i );
  2058. lineDistances[ j ] = ( j === 0 ) ? 0 : lineDistances[ j - 1 ];
  2059. lineDistances[ j + 1 ] = lineDistances[ j ] + _start.distanceTo( _end );
  2060. }
  2061. const instanceDistanceBuffer = new three__WEBPACK_IMPORTED_MODULE_0__.InstancedInterleavedBuffer( lineDistances, 2, 1 ); // d0, d1
  2062. geometry.setAttribute( 'instanceDistanceStart', new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 0 ) ); // d0
  2063. geometry.setAttribute( 'instanceDistanceEnd', new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 1 ) ); // d1
  2064. return this;
  2065. }
  2066. raycast( raycaster, intersects ) {
  2067. if ( raycaster.camera === null ) {
  2068. console.error( 'LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.' );
  2069. }
  2070. const threshold = ( raycaster.params.Line2 !== undefined ) ? raycaster.params.Line2.threshold || 0 : 0;
  2071. const ray = raycaster.ray;
  2072. const camera = raycaster.camera;
  2073. const projectionMatrix = camera.projectionMatrix;
  2074. const matrixWorld = this.matrixWorld;
  2075. const geometry = this.geometry;
  2076. const material = this.material;
  2077. const resolution = material.resolution;
  2078. const lineWidth = material.linewidth + threshold;
  2079. const instanceStart = geometry.attributes.instanceStart;
  2080. const instanceEnd = geometry.attributes.instanceEnd;
  2081. // camera forward is negative
  2082. const near = - camera.near;
  2083. // clip space is [ - 1, 1 ] so multiply by two to get the full
  2084. // width in clip space
  2085. const ssMaxWidth = 2.0 * Math.max( lineWidth / resolution.width, lineWidth / resolution.height );
  2086. //
  2087. // check if we intersect the sphere bounds
  2088. if ( geometry.boundingSphere === null ) {
  2089. geometry.computeBoundingSphere();
  2090. }
  2091. _sphere.copy( geometry.boundingSphere ).applyMatrix4( matrixWorld );
  2092. const distanceToSphere = Math.max( camera.near, _sphere.distanceToPoint( ray.origin ) );
  2093. // get the w component to scale the world space line width
  2094. _clipToWorldVector.set( 0, 0, - distanceToSphere, 1.0 ).applyMatrix4( camera.projectionMatrix );
  2095. _clipToWorldVector.multiplyScalar( 1.0 / _clipToWorldVector.w );
  2096. _clipToWorldVector.applyMatrix4( camera.projectionMatrixInverse );
  2097. // increase the sphere bounds by the worst case line screen space width
  2098. const sphereMargin = Math.abs( ssMaxWidth / _clipToWorldVector.w ) * 0.5;
  2099. _sphere.radius += sphereMargin;
  2100. if ( raycaster.ray.intersectsSphere( _sphere ) === false ) {
  2101. return;
  2102. }
  2103. //
  2104. // check if we intersect the box bounds
  2105. if ( geometry.boundingBox === null ) {
  2106. geometry.computeBoundingBox();
  2107. }
  2108. _box.copy( geometry.boundingBox ).applyMatrix4( matrixWorld );
  2109. const distanceToBox = Math.max( camera.near, _box.distanceToPoint( ray.origin ) );
  2110. // get the w component to scale the world space line width
  2111. _clipToWorldVector.set( 0, 0, - distanceToBox, 1.0 ).applyMatrix4( camera.projectionMatrix );
  2112. _clipToWorldVector.multiplyScalar( 1.0 / _clipToWorldVector.w );
  2113. _clipToWorldVector.applyMatrix4( camera.projectionMatrixInverse );
  2114. // increase the sphere bounds by the worst case line screen space width
  2115. const boxMargin = Math.abs( ssMaxWidth / _clipToWorldVector.w ) * 0.5;
  2116. _box.max.x += boxMargin;
  2117. _box.max.y += boxMargin;
  2118. _box.max.z += boxMargin;
  2119. _box.min.x -= boxMargin;
  2120. _box.min.y -= boxMargin;
  2121. _box.min.z -= boxMargin;
  2122. if ( raycaster.ray.intersectsBox( _box ) === false ) {
  2123. return;
  2124. }
  2125. //
  2126. // pick a point 1 unit out along the ray to avoid the ray origin
  2127. // sitting at the camera origin which will cause "w" to be 0 when
  2128. // applying the projection matrix.
  2129. ray.at( 1, _ssOrigin );
  2130. // ndc space [ - 1.0, 1.0 ]
  2131. _ssOrigin.w = 1;
  2132. _ssOrigin.applyMatrix4( camera.matrixWorldInverse );
  2133. _ssOrigin.applyMatrix4( projectionMatrix );
  2134. _ssOrigin.multiplyScalar( 1 / _ssOrigin.w );
  2135. // screen space
  2136. _ssOrigin.x *= resolution.x / 2;
  2137. _ssOrigin.y *= resolution.y / 2;
  2138. _ssOrigin.z = 0;
  2139. _ssOrigin3.copy( _ssOrigin );
  2140. _mvMatrix.multiplyMatrices( camera.matrixWorldInverse, matrixWorld );
  2141. for ( let i = 0, l = instanceStart.count; i < l; i ++ ) {
  2142. _start4.fromBufferAttribute( instanceStart, i );
  2143. _end4.fromBufferAttribute( instanceEnd, i );
  2144. _start4.w = 1;
  2145. _end4.w = 1;
  2146. // camera space
  2147. _start4.applyMatrix4( _mvMatrix );
  2148. _end4.applyMatrix4( _mvMatrix );
  2149. // skip the segment if it's entirely behind the camera
  2150. var isBehindCameraNear = _start4.z > near && _end4.z > near;
  2151. if ( isBehindCameraNear ) {
  2152. continue;
  2153. }
  2154. // trim the segment if it extends behind camera near
  2155. if ( _start4.z > near ) {
  2156. const deltaDist = _start4.z - _end4.z;
  2157. const t = ( _start4.z - near ) / deltaDist;
  2158. _start4.lerp( _end4, t );
  2159. } else if ( _end4.z > near ) {
  2160. const deltaDist = _end4.z - _start4.z;
  2161. const t = ( _end4.z - near ) / deltaDist;
  2162. _end4.lerp( _start4, t );
  2163. }
  2164. // clip space
  2165. _start4.applyMatrix4( projectionMatrix );
  2166. _end4.applyMatrix4( projectionMatrix );
  2167. // ndc space [ - 1.0, 1.0 ]
  2168. _start4.multiplyScalar( 1 / _start4.w );
  2169. _end4.multiplyScalar( 1 / _end4.w );
  2170. // screen space
  2171. _start4.x *= resolution.x / 2;
  2172. _start4.y *= resolution.y / 2;
  2173. _end4.x *= resolution.x / 2;
  2174. _end4.y *= resolution.y / 2;
  2175. // create 2d segment
  2176. _line.start.copy( _start4 );
  2177. _line.start.z = 0;
  2178. _line.end.copy( _end4 );
  2179. _line.end.z = 0;
  2180. // get closest point on ray to segment
  2181. const param = _line.closestPointToPointParameter( _ssOrigin3, true );
  2182. _line.at( param, _closestPoint );
  2183. // check if the intersection point is within clip space
  2184. const zPos = three__WEBPACK_IMPORTED_MODULE_0__.MathUtils.lerp( _start4.z, _end4.z, param );
  2185. const isInClipSpace = zPos >= - 1 && zPos <= 1;
  2186. const isInside = _ssOrigin3.distanceTo( _closestPoint ) < lineWidth * 0.5;
  2187. if ( isInClipSpace && isInside ) {
  2188. _line.start.fromBufferAttribute( instanceStart, i );
  2189. _line.end.fromBufferAttribute( instanceEnd, i );
  2190. _line.start.applyMatrix4( matrixWorld );
  2191. _line.end.applyMatrix4( matrixWorld );
  2192. const pointOnLine = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();
  2193. const point = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();
  2194. ray.distanceSqToSegment( _line.start, _line.end, point, pointOnLine );
  2195. intersects.push( {
  2196. point: point,
  2197. pointOnLine: pointOnLine,
  2198. distance: ray.origin.distanceTo( point ),
  2199. object: this,
  2200. face: null,
  2201. faceIndex: i,
  2202. uv: null,
  2203. uv2: null,
  2204. } );
  2205. }
  2206. }
  2207. }
  2208. }
  2209. LineSegments2.prototype.LineSegments2 = true;
  2210. /***/ }),
  2211. /***/ "./node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js":
  2212. /*!***********************************************************************!*\
  2213. !*** ./node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js ***!
  2214. \***********************************************************************/
  2215. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  2216. __webpack_require__.r(__webpack_exports__);
  2217. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2218. /* harmony export */ "LineSegmentsGeometry": () => (/* binding */ LineSegmentsGeometry)
  2219. /* harmony export */ });
  2220. /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ "three");
  2221. const _box = new three__WEBPACK_IMPORTED_MODULE_0__.Box3();
  2222. const _vector = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();
  2223. class LineSegmentsGeometry extends three__WEBPACK_IMPORTED_MODULE_0__.InstancedBufferGeometry {
  2224. constructor() {
  2225. super();
  2226. this.type = 'LineSegmentsGeometry';
  2227. const positions = [ - 1, 2, 0, 1, 2, 0, - 1, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, - 1, - 1, 0, 1, - 1, 0 ];
  2228. const uvs = [ - 1, 2, 1, 2, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 2, 1, - 2 ];
  2229. const index = [ 0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5 ];
  2230. this.setIndex( index );
  2231. this.setAttribute( 'position', new three__WEBPACK_IMPORTED_MODULE_0__.Float32BufferAttribute( positions, 3 ) );
  2232. this.setAttribute( 'uv', new three__WEBPACK_IMPORTED_MODULE_0__.Float32BufferAttribute( uvs, 2 ) );
  2233. }
  2234. applyMatrix4( matrix ) {
  2235. const start = this.attributes.instanceStart;
  2236. const end = this.attributes.instanceEnd;
  2237. if ( start !== undefined ) {
  2238. start.applyMatrix4( matrix );
  2239. end.applyMatrix4( matrix );
  2240. start.needsUpdate = true;
  2241. }
  2242. if ( this.boundingBox !== null ) {
  2243. this.computeBoundingBox();
  2244. }
  2245. if ( this.boundingSphere !== null ) {
  2246. this.computeBoundingSphere();
  2247. }
  2248. return this;
  2249. }
  2250. setPositions( array ) {
  2251. let lineSegments;
  2252. if ( array instanceof Float32Array ) {
  2253. lineSegments = array;
  2254. } else if ( Array.isArray( array ) ) {
  2255. lineSegments = new Float32Array( array );
  2256. }
  2257. const instanceBuffer = new three__WEBPACK_IMPORTED_MODULE_0__.InstancedInterleavedBuffer( lineSegments, 6, 1 ); // xyz, xyz
  2258. this.setAttribute( 'instanceStart', new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute( instanceBuffer, 3, 0 ) ); // xyz
  2259. this.setAttribute( 'instanceEnd', new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute( instanceBuffer, 3, 3 ) ); // xyz
  2260. //
  2261. this.computeBoundingBox();
  2262. this.computeBoundingSphere();
  2263. return this;
  2264. }
  2265. setColors( array ) {
  2266. let colors;
  2267. if ( array instanceof Float32Array ) {
  2268. colors = array;
  2269. } else if ( Array.isArray( array ) ) {
  2270. colors = new Float32Array( array );
  2271. }
  2272. const instanceColorBuffer = new three__WEBPACK_IMPORTED_MODULE_0__.InstancedInterleavedBuffer( colors, 6, 1 ); // rgb, rgb
  2273. this.setAttribute( 'instanceColorStart', new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute( instanceColorBuffer, 3, 0 ) ); // rgb
  2274. this.setAttribute( 'instanceColorEnd', new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute( instanceColorBuffer, 3, 3 ) ); // rgb
  2275. return this;
  2276. }
  2277. fromWireframeGeometry( geometry ) {
  2278. this.setPositions( geometry.attributes.position.array );
  2279. return this;
  2280. }
  2281. fromEdgesGeometry( geometry ) {
  2282. this.setPositions( geometry.attributes.position.array );
  2283. return this;
  2284. }
  2285. fromMesh( mesh ) {
  2286. this.fromWireframeGeometry( new three__WEBPACK_IMPORTED_MODULE_0__.WireframeGeometry( mesh.geometry ) );
  2287. // set colors, maybe
  2288. return this;
  2289. }
  2290. fromLineSegments( lineSegments ) {
  2291. const geometry = lineSegments.geometry;
  2292. if ( geometry.isGeometry ) {
  2293. console.error( 'THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.' );
  2294. return;
  2295. } else if ( geometry.isBufferGeometry ) {
  2296. this.setPositions( geometry.attributes.position.array ); // assumes non-indexed
  2297. }
  2298. // set colors, maybe
  2299. return this;
  2300. }
  2301. computeBoundingBox() {
  2302. if ( this.boundingBox === null ) {
  2303. this.boundingBox = new three__WEBPACK_IMPORTED_MODULE_0__.Box3();
  2304. }
  2305. const start = this.attributes.instanceStart;
  2306. const end = this.attributes.instanceEnd;
  2307. if ( start !== undefined && end !== undefined ) {
  2308. this.boundingBox.setFromBufferAttribute( start );
  2309. _box.setFromBufferAttribute( end );
  2310. this.boundingBox.union( _box );
  2311. }
  2312. }
  2313. computeBoundingSphere() {
  2314. if ( this.boundingSphere === null ) {
  2315. this.boundingSphere = new three__WEBPACK_IMPORTED_MODULE_0__.Sphere();
  2316. }
  2317. if ( this.boundingBox === null ) {
  2318. this.computeBoundingBox();
  2319. }
  2320. const start = this.attributes.instanceStart;
  2321. const end = this.attributes.instanceEnd;
  2322. if ( start !== undefined && end !== undefined ) {
  2323. const center = this.boundingSphere.center;
  2324. this.boundingBox.getCenter( center );
  2325. let maxRadiusSq = 0;
  2326. for ( let i = 0, il = start.count; i < il; i ++ ) {
  2327. _vector.fromBufferAttribute( start, i );
  2328. maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector ) );
  2329. _vector.fromBufferAttribute( end, i );
  2330. maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector ) );
  2331. }
  2332. this.boundingSphere.radius = Math.sqrt( maxRadiusSq );
  2333. if ( isNaN( this.boundingSphere.radius ) ) {
  2334. console.error( 'THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.', this );
  2335. }
  2336. }
  2337. }
  2338. toJSON() {
  2339. // todo
  2340. }
  2341. applyMatrix( matrix ) {
  2342. console.warn( 'THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4().' );
  2343. return this.applyMatrix4( matrix );
  2344. }
  2345. }
  2346. LineSegmentsGeometry.prototype.isLineSegmentsGeometry = true;
  2347. /***/ })
  2348. /******/ });
  2349. /************************************************************************/
  2350. /******/ // The module cache
  2351. /******/ var __webpack_module_cache__ = {};
  2352. /******/
  2353. /******/ // The require function
  2354. /******/ function __webpack_require__(moduleId) {
  2355. /******/ // Check if module is in cache
  2356. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  2357. /******/ if (cachedModule !== undefined) {
  2358. /******/ return cachedModule.exports;
  2359. /******/ }
  2360. /******/ // Create a new module (and put it into the cache)
  2361. /******/ var module = __webpack_module_cache__[moduleId] = {
  2362. /******/ // no module.id needed
  2363. /******/ // no module.loaded needed
  2364. /******/ exports: {}
  2365. /******/ };
  2366. /******/
  2367. /******/ // Execute the module function
  2368. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  2369. /******/
  2370. /******/ // Return the exports of the module
  2371. /******/ return module.exports;
  2372. /******/ }
  2373. /******/
  2374. /******/ // expose the modules object (__webpack_modules__)
  2375. /******/ __webpack_require__.m = __webpack_modules__;
  2376. /******/
  2377. /************************************************************************/
  2378. /******/ /* webpack/runtime/chunk loaded */
  2379. /******/ (() => {
  2380. /******/ var deferred = [];
  2381. /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
  2382. /******/ if(chunkIds) {
  2383. /******/ priority = priority || 0;
  2384. /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
  2385. /******/ deferred[i] = [chunkIds, fn, priority];
  2386. /******/ return;
  2387. /******/ }
  2388. /******/ var notFulfilled = Infinity;
  2389. /******/ for (var i = 0; i < deferred.length; i++) {
  2390. /******/ var [chunkIds, fn, priority] = deferred[i];
  2391. /******/ var fulfilled = true;
  2392. /******/ for (var j = 0; j < chunkIds.length; j++) {
  2393. /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
  2394. /******/ chunkIds.splice(j--, 1);
  2395. /******/ } else {
  2396. /******/ fulfilled = false;
  2397. /******/ if(priority < notFulfilled) notFulfilled = priority;
  2398. /******/ }
  2399. /******/ }
  2400. /******/ if(fulfilled) {
  2401. /******/ deferred.splice(i--, 1)
  2402. /******/ var r = fn();
  2403. /******/ if (r !== undefined) result = r;
  2404. /******/ }
  2405. /******/ }
  2406. /******/ return result;
  2407. /******/ };
  2408. /******/ })();
  2409. /******/
  2410. /******/ /* webpack/runtime/compat get default export */
  2411. /******/ (() => {
  2412. /******/ // getDefaultExport function for compatibility with non-harmony modules
  2413. /******/ __webpack_require__.n = (module) => {
  2414. /******/ var getter = module && module.__esModule ?
  2415. /******/ () => (module['default']) :
  2416. /******/ () => (module);
  2417. /******/ __webpack_require__.d(getter, { a: getter });
  2418. /******/ return getter;
  2419. /******/ };
  2420. /******/ })();
  2421. /******/
  2422. /******/ /* webpack/runtime/define property getters */
  2423. /******/ (() => {
  2424. /******/ // define getter functions for harmony exports
  2425. /******/ __webpack_require__.d = (exports, definition) => {
  2426. /******/ for(var key in definition) {
  2427. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  2428. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  2429. /******/ }
  2430. /******/ }
  2431. /******/ };
  2432. /******/ })();
  2433. /******/
  2434. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  2435. /******/ (() => {
  2436. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  2437. /******/ })();
  2438. /******/
  2439. /******/ /* webpack/runtime/make namespace object */
  2440. /******/ (() => {
  2441. /******/ // define __esModule on exports
  2442. /******/ __webpack_require__.r = (exports) => {
  2443. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  2444. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  2445. /******/ }
  2446. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  2447. /******/ };
  2448. /******/ })();
  2449. /******/
  2450. /******/ /* webpack/runtime/jsonp chunk loading */
  2451. /******/ (() => {
  2452. /******/ // no baseURI
  2453. /******/
  2454. /******/ // object to store loaded and loading chunks
  2455. /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
  2456. /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
  2457. /******/ var installedChunks = {
  2458. /******/ "rogue-engine-user-scripts": 0
  2459. /******/ };
  2460. /******/
  2461. /******/ // no chunk on demand loading
  2462. /******/
  2463. /******/ // no prefetching
  2464. /******/
  2465. /******/ // no preloaded
  2466. /******/
  2467. /******/ // no HMR
  2468. /******/
  2469. /******/ // no HMR manifest
  2470. /******/
  2471. /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
  2472. /******/
  2473. /******/ // install a JSONP callback for chunk loading
  2474. /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
  2475. /******/ var [chunkIds, moreModules, runtime] = data;
  2476. /******/ // add "moreModules" to the modules object,
  2477. /******/ // then flag all "chunkIds" as loaded and fire callback
  2478. /******/ var moduleId, chunkId, i = 0;
  2479. /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
  2480. /******/ for(moduleId in moreModules) {
  2481. /******/ if(__webpack_require__.o(moreModules, moduleId)) {
  2482. /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
  2483. /******/ }
  2484. /******/ }
  2485. /******/ if(runtime) var result = runtime(__webpack_require__);
  2486. /******/ }
  2487. /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
  2488. /******/ for(;i < chunkIds.length; i++) {
  2489. /******/ chunkId = chunkIds[i];
  2490. /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
  2491. /******/ installedChunks[chunkId][0]();
  2492. /******/ }
  2493. /******/ installedChunks[chunkId] = 0;
  2494. /******/ }
  2495. /******/ return __webpack_require__.O(result);
  2496. /******/ }
  2497. /******/
  2498. /******/ var chunkLoadingGlobal = self["webpackChunk_name_"] = self["webpackChunk_name_"] || [];
  2499. /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
  2500. /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
  2501. /******/ })();
  2502. /******/
  2503. /************************************************************************/
  2504. /******/
  2505. /******/ // startup
  2506. /******/ // Load entry module and return exports
  2507. /******/ // This entry module is referenced by other modules so it can't be inlined
  2508. /******/ __webpack_require__("./Assets/Components/CombatLogic.re.js");
  2509. /******/ __webpack_require__("./Assets/Components/FloatObject.re.js");
  2510. /******/ __webpack_require__("./Assets/Components/HouseRaycastReceiver.re.js");
  2511. /******/ __webpack_require__("./Assets/Components/Library/AsyncLoader.js");
  2512. /******/ __webpack_require__("./Assets/Components/Library/Easings.js");
  2513. /******/ __webpack_require__("./Assets/Components/Library/GameData.js");
  2514. /******/ __webpack_require__("./Assets/Components/Library/SimpleTweens.js");
  2515. /******/ __webpack_require__("./Assets/Components/OrbitCamera.re.js");
  2516. /******/ __webpack_require__("./Assets/Components/ParticleSystem.re.js");
  2517. /******/ __webpack_require__("./Assets/Components/Pathway.re.js");
  2518. /******/ __webpack_require__("./Assets/Components/RaycastReceiver.re.js");
  2519. /******/ __webpack_require__("./Assets/Components/RaycastReporter.re.js");
  2520. /******/ __webpack_require__("./Assets/Components/SceneLinkRaycastReceiver.re.js");
  2521. /******/ __webpack_require__("./Assets/Components/ScrollObject.re.js");
  2522. /******/ __webpack_require__("./Assets/Components/ScrollTexture.re.js");
  2523. /******/ __webpack_require__("./Assets/Components/TileRaycastReceiver.re.js");
  2524. /******/ var __webpack_exports__ = __webpack_require__("./Assets/Components/TitleScreenControl.re.js");
  2525. /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
  2526. /******/
  2527. /******/ return __webpack_exports__;
  2528. /******/ })()
  2529. ;
  2530. });
  2531. //# sourceMappingURL=rogue-engine-user-scripts.js.map