(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "three"], factory); } else if (typeof exports !== "undefined") { factory(exports, require("three")); } else { var mod = { exports: {} }; factory(mod.exports, global.three); global.RoomEnvironment = mod.exports; } })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _three) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.RoomEnvironment = void 0; function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var RoomEnvironment = /*#__PURE__*/function (_Scene) { _inherits(RoomEnvironment, _Scene); var _super = _createSuper(RoomEnvironment); function RoomEnvironment() { var _this; _classCallCheck(this, RoomEnvironment); _this = _super.call(this); var geometry = new _three.BoxGeometry(); geometry.deleteAttribute('uv'); var roomMaterial = new _three.MeshStandardMaterial({ side: _three.BackSide }); var boxMaterial = new _three.MeshStandardMaterial(); var mainLight = new _three.PointLight(0xffffff, 5.0, 28, 2); mainLight.position.set(0.418, 16.199, 0.300); _this.add(mainLight); var room = new _three.Mesh(geometry, roomMaterial); room.position.set(-0.757, 13.219, 0.717); room.scale.set(31.713, 28.305, 28.591); _this.add(room); var box1 = new _three.Mesh(geometry, boxMaterial); box1.position.set(-10.906, 2.009, 1.846); box1.rotation.set(0, -0.195, 0); box1.scale.set(2.328, 7.905, 4.651); _this.add(box1); var box2 = new _three.Mesh(geometry, boxMaterial); box2.position.set(-5.607, -0.754, -0.758); box2.rotation.set(0, 0.994, 0); box2.scale.set(1.970, 1.534, 3.955); _this.add(box2); var box3 = new _three.Mesh(geometry, boxMaterial); box3.position.set(6.167, 0.857, 7.803); box3.rotation.set(0, 0.561, 0); box3.scale.set(3.927, 6.285, 3.687); _this.add(box3); var box4 = new _three.Mesh(geometry, boxMaterial); box4.position.set(-2.017, 0.018, 6.124); box4.rotation.set(0, 0.333, 0); box4.scale.set(2.002, 4.566, 2.064); _this.add(box4); var box5 = new _three.Mesh(geometry, boxMaterial); box5.position.set(2.291, -0.756, -2.621); box5.rotation.set(0, -0.286, 0); box5.scale.set(1.546, 1.552, 1.496); _this.add(box5); var box6 = new _three.Mesh(geometry, boxMaterial); box6.position.set(-2.193, -0.369, -5.547); box6.rotation.set(0, 0.516, 0); box6.scale.set(3.875, 3.487, 2.986); _this.add(box6); // -x right var light1 = new _three.Mesh(geometry, createAreaLightMaterial(50)); light1.position.set(-16.116, 14.37, 8.208); light1.scale.set(0.1, 2.428, 2.739); _this.add(light1); // -x left var light2 = new _three.Mesh(geometry, createAreaLightMaterial(50)); light2.position.set(-16.109, 18.021, -8.207); light2.scale.set(0.1, 2.425, 2.751); _this.add(light2); // +x var light3 = new _three.Mesh(geometry, createAreaLightMaterial(17)); light3.position.set(14.904, 12.198, -1.832); light3.scale.set(0.15, 4.265, 6.331); _this.add(light3); // +z var light4 = new _three.Mesh(geometry, createAreaLightMaterial(43)); light4.position.set(-0.462, 8.89, 14.520); light4.scale.set(4.38, 5.441, 0.088); _this.add(light4); // -z var light5 = new _three.Mesh(geometry, createAreaLightMaterial(20)); light5.position.set(3.235, 11.486, -12.541); light5.scale.set(2.5, 2.0, 0.1); _this.add(light5); // +y var light6 = new _three.Mesh(geometry, createAreaLightMaterial(100)); light6.position.set(0.0, 20.0, 0.0); light6.scale.set(1.0, 0.1, 1.0); _this.add(light6); return _this; } return _createClass(RoomEnvironment); }(_three.Scene); _exports.RoomEnvironment = RoomEnvironment; function createAreaLightMaterial(intensity) { var material = new _three.MeshBasicMaterial(); material.color.setScalar(intensity); return material; } });