kitchen-simulator 1.1.1-test.72 → 1.1.1-test.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/@history.js +2 -5
- package/es/AppContext.js +3 -6
- package/es/KitchenConfigurator.js +86 -86
- package/es/KitchenConfiguratorApp.js +134 -128
- package/es/actions/area-actions.js +5 -8
- package/es/actions/export.js +12 -24
- package/es/actions/groups-actions.js +27 -41
- package/es/actions/holes-actions.js +34 -51
- package/es/actions/items-actions.js +94 -141
- package/es/actions/lines-actions.js +21 -32
- package/es/actions/project-actions.js +94 -141
- package/es/actions/scene-actions.js +11 -17
- package/es/actions/vertices-actions.js +7 -11
- package/es/actions/viewer2d-actions.js +21 -32
- package/es/actions/viewer3d-actions.js +9 -14
- package/es/catalog/areas/area/planner-element.js +2 -5
- package/es/catalog/catalog.js +15 -17
- package/es/catalog/factories/area-factory-3d.js +22 -26
- package/es/catalog/factories/area-factory.js +13 -15
- package/es/catalog/factories/export.js +6 -10
- package/es/catalog/factories/wall-factory-3d.js +31 -36
- package/es/catalog/factories/wall-factory.js +21 -26
- package/es/catalog/holes/door-closet/planner-element.js +15 -19
- package/es/catalog/holes/door-double/planner-element.js +15 -19
- package/es/catalog/holes/door-exterior/planner-element.js +16 -20
- package/es/catalog/holes/door-interior/planner-element.js +16 -20
- package/es/catalog/holes/door-panic/planner-element.js +7 -11
- package/es/catalog/holes/door-panic-double/planner-element.js +15 -19
- package/es/catalog/holes/door-sliding/planner-element.js +17 -21
- package/es/catalog/holes/doorway-framed/planner-element.js +11 -15
- package/es/catalog/holes/doorway-frameless/planner-element.js +7 -11
- package/es/catalog/holes/export.js +13 -29
- package/es/catalog/holes/window-clear/planner-element.js +10 -14
- package/es/catalog/holes/window-cross/planner-element.js +10 -14
- package/es/catalog/holes/window-double-hung/planner-element.js +10 -14
- package/es/catalog/holes/window-vertical/planner-element.js +10 -14
- package/es/catalog/lines/wall/planner-element.js +2 -5
- package/es/catalog/molding/molding-dcm/planner-element.js +5 -9
- package/es/catalog/molding/molding-fbm/planner-element.js +5 -9
- package/es/catalog/molding/molding-lrm/planner-element.js +5 -9
- package/es/catalog/properties/export.js +20 -31
- package/es/catalog/properties/property-checkbox.js +28 -29
- package/es/catalog/properties/property-color.js +16 -19
- package/es/catalog/properties/property-enum.js +24 -27
- package/es/catalog/properties/property-hidden.js +9 -12
- package/es/catalog/properties/property-lenght-measure.js +38 -41
- package/es/catalog/properties/property-length-measure.js +36 -39
- package/es/catalog/properties/property-length-measure_hole.js +38 -41
- package/es/catalog/properties/property-number.js +17 -20
- package/es/catalog/properties/property-read-only.js +16 -19
- package/es/catalog/properties/property-string.js +16 -19
- package/es/catalog/properties/property-toggle.js +16 -19
- package/es/catalog/properties/shared-property-style.js +1 -3
- package/es/catalog/utils/FuseUtils.js +12 -13
- package/es/catalog/utils/exporter.js +10 -11
- package/es/catalog/utils/geom-utils.js +13 -24
- package/es/catalog/utils/item-loader.js +86 -92
- package/es/catalog/utils/load-obj.js +20 -24
- package/es/catalog/utils/mtl-loader.js +3 -4
- package/es/catalog/utils/obj-loader.js +3 -4
- package/es/class/FuseUtils.js +12 -13
- package/es/class/area.js +24 -24
- package/es/class/export.js +23 -36
- package/es/class/group.js +53 -55
- package/es/class/guide.js +15 -17
- package/es/class/hole.js +83 -85
- package/es/class/item.js +155 -155
- package/es/class/layer.js +59 -61
- package/es/class/line.js +135 -138
- package/es/class/project.js +93 -94
- package/es/class/vertex.js +29 -31
- package/es/components/content.js +19 -23
- package/es/components/disclaimer/disclaimer.js +10 -13
- package/es/components/export.js +8 -13
- package/es/components/style/button.js +25 -25
- package/es/components/style/cancel-button.js +7 -10
- package/es/components/style/content-container.js +11 -12
- package/es/components/style/content-title.js +13 -15
- package/es/components/style/delete-button.js +8 -12
- package/es/components/style/export.js +30 -46
- package/es/components/style/form-block.js +10 -11
- package/es/components/style/form-color-input.js +7 -10
- package/es/components/style/form-label.js +10 -11
- package/es/components/style/form-number-input.js +45 -43
- package/es/components/style/form-number-input_2.js +41 -39
- package/es/components/style/form-select.js +19 -20
- package/es/components/style/form-slider.js +10 -13
- package/es/components/style/form-submit-button.js +8 -12
- package/es/components/style/form-text-input.js +30 -28
- package/es/components/viewer2d/area.js +17 -20
- package/es/components/viewer2d/export.js +30 -46
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +10 -13
- package/es/components/viewer2d/grids/grid-streak.js +10 -13
- package/es/components/viewer2d/grids/grid-vertical-streak.js +10 -13
- package/es/components/viewer2d/grids/grids.js +10 -14
- package/es/components/viewer2d/group.js +15 -19
- package/es/components/viewer2d/item.js +61 -65
- package/es/components/viewer2d/layer.js +23 -26
- package/es/components/viewer2d/line.js +101 -106
- package/es/components/viewer2d/ruler.js +22 -25
- package/es/components/viewer2d/rulerDist.js +21 -24
- package/es/components/viewer2d/rulerX.js +46 -44
- package/es/components/viewer2d/rulerY.js +44 -42
- package/es/components/viewer2d/scene.js +34 -34
- package/es/components/viewer2d/snap.js +13 -17
- package/es/components/viewer2d/state.js +18 -22
- package/es/components/viewer2d/utils.js +24 -33
- package/es/components/viewer2d/vertex.js +8 -12
- package/es/components/viewer2d/viewer2d.js +156 -159
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +21 -19
- package/es/components/viewer3d/dcm.js +1 -3
- package/es/components/viewer3d/fbm.js +1 -3
- package/es/components/viewer3d/front3D.js +12 -16
- package/es/components/viewer3d/grid-creator.js +8 -12
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +6 -9
- package/es/components/viewer3d/grids/grid-streak.js +5 -8
- package/es/components/viewer3d/grids/grid-vertical-streak.js +6 -9
- package/es/components/viewer3d/libs/first-person-controls.js +2 -5
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1 -3
- package/es/components/viewer3d/libs/mtl-loader.js +1 -3
- package/es/components/viewer3d/libs/obj-loader.js +1 -3
- package/es/components/viewer3d/libs/orbit-controls.js +2 -4
- package/es/components/viewer3d/libs/pointer-lock-controls.js +2 -4
- package/es/components/viewer3d/lrm.js +1 -3
- package/es/components/viewer3d/model.js +1 -3
- package/es/components/viewer3d/pointer-lock-navigation.js +3 -6
- package/es/components/viewer3d/ruler-utils/itemRect.js +18 -21
- package/es/components/viewer3d/ruler-utils/layer3D.js +59 -62
- package/es/components/viewer3d/ruler-utils/ruler3D.js +42 -43
- package/es/components/viewer3d/ruler-utils/scene3D.js +9 -13
- package/es/components/viewer3d/ruler-utils/state3D.js +4 -7
- package/es/components/viewer3d/scene-creator.js +197 -223
- package/es/components/viewer3d/three-memory-cleaner.js +3 -7
- package/es/components/viewer3d/viewer3d-first-person.js +42 -42
- package/es/components/viewer3d/viewer3d.js +200 -198
- package/es/constants.js +349 -354
- package/es/index.js +7 -11
- package/es/models.js +193 -191
- package/es/plugins/SVGLoader.js +48 -49
- package/es/plugins/autosave.js +3 -5
- package/es/plugins/console-debugger.js +6 -7
- package/es/plugins/export.js +8 -13
- package/es/plugins/keyboard.js +29 -31
- package/es/reducers/areas-reducer.js +7 -9
- package/es/reducers/export.js +24 -37
- package/es/reducers/groups-reducer.js +31 -33
- package/es/reducers/holes-reducer.js +43 -45
- package/es/reducers/items-reducer.js +106 -108
- package/es/reducers/lines-reducer.js +28 -30
- package/es/reducers/project-reducer.js +105 -107
- package/es/reducers/reducer.js +16 -19
- package/es/reducers/scene-reducer.js +15 -17
- package/es/reducers/user-reducer.js +5 -7
- package/es/reducers/vertices-reducer.js +11 -13
- package/es/reducers/viewer2d-reducer.js +18 -20
- package/es/reducers/viewer3d-reducer.js +16 -18
- package/es/shared-style.js +10 -12
- package/es/styles/export.js +3 -6
- package/es/translator/en.js +1 -3
- package/es/translator/it.js +1 -3
- package/es/translator/ru.js +1 -3
- package/es/translator/translator.js +13 -15
- package/es/utils/browser.js +2 -5
- package/es/utils/convert-units-lite.js +1 -3
- package/es/utils/email-validator.js +1 -3
- package/es/utils/export.js +15 -29
- package/es/utils/geometry.js +190 -280
- package/es/utils/get-edges-of-subgraphs.js +2 -5
- package/es/utils/graph-cycles.js +8 -7
- package/es/utils/graph-inner-cycles.js +10 -14
- package/es/utils/graph.js +9 -13
- package/es/utils/helper.js +41 -58
- package/es/utils/history.js +8 -11
- package/es/utils/id-broker.js +8 -11
- package/es/utils/logger.js +1 -3
- package/es/utils/math.js +5 -8
- package/es/utils/molding.js +130 -146
- package/es/utils/name-generator.js +7 -9
- package/es/utils/objects-utils.js +7 -14
- package/es/utils/phone-validator.js +1 -3
- package/es/utils/process-black-list.js +5 -6
- package/es/utils/react-if.js +7 -9
- package/es/utils/snap-scene.js +27 -30
- package/es/utils/snap.js +53 -57
- package/es/utils/summarizeCart.js +1 -3
- package/es/utils/threeCSG.es6.js +13 -17
- package/es/version.js +1 -3
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
1
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
2
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
3
|
+
import _get from "@babel/runtime/helpers/esm/get";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
6
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
9
10
|
/*!
|
|
10
11
|
* camera-controls
|
|
11
12
|
* https://github.com/yomotsu/camera-controls
|
|
@@ -176,9 +177,9 @@ function notSupportedInOrthographicCamera(camera, message) {
|
|
|
176
177
|
}
|
|
177
178
|
return false;
|
|
178
179
|
}
|
|
179
|
-
var EventDispatcher =
|
|
180
|
+
var EventDispatcher = /*#__PURE__*/function () {
|
|
180
181
|
function EventDispatcher() {
|
|
181
|
-
(
|
|
182
|
+
_classCallCheck(this, EventDispatcher);
|
|
182
183
|
this._listeners = {};
|
|
183
184
|
}
|
|
184
185
|
/**
|
|
@@ -187,7 +188,7 @@ var EventDispatcher = exports.EventDispatcher = /*#__PURE__*/function () {
|
|
|
187
188
|
* @param listener handler function
|
|
188
189
|
* @category Methods
|
|
189
190
|
*/
|
|
190
|
-
return (
|
|
191
|
+
return _createClass(EventDispatcher, [{
|
|
191
192
|
key: "addEventListener",
|
|
192
193
|
value: function addEventListener(type, listener) {
|
|
193
194
|
var listeners = this._listeners;
|
|
@@ -283,7 +284,7 @@ var _quaternionA;
|
|
|
283
284
|
var _quaternionB;
|
|
284
285
|
var _rotationMatrix;
|
|
285
286
|
var _raycaster;
|
|
286
|
-
var CameraControls =
|
|
287
|
+
var CameraControls = /*#__PURE__*/function (_EventDispatcher) {
|
|
287
288
|
/**
|
|
288
289
|
* Creates a `CameraControls` instance.
|
|
289
290
|
*
|
|
@@ -303,8 +304,8 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
303
304
|
*/
|
|
304
305
|
function CameraControls(camera, domElement) {
|
|
305
306
|
var _this;
|
|
306
|
-
(
|
|
307
|
-
_this = (
|
|
307
|
+
_classCallCheck(this, CameraControls);
|
|
308
|
+
_this = _callSuper(this, CameraControls);
|
|
308
309
|
/**
|
|
309
310
|
* Minimum vertical angle in radians.
|
|
310
311
|
* The angle has to be between `0` and `.maxPolarAngle` inclusive.
|
|
@@ -1017,8 +1018,8 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1017
1018
|
* The camera to be controlled
|
|
1018
1019
|
* @category Properties
|
|
1019
1020
|
*/
|
|
1020
|
-
(
|
|
1021
|
-
return (
|
|
1021
|
+
_inherits(CameraControls, _EventDispatcher);
|
|
1022
|
+
return _createClass(CameraControls, [{
|
|
1022
1023
|
key: "camera",
|
|
1023
1024
|
get: function get() {
|
|
1024
1025
|
return this._camera;
|
|
@@ -1177,7 +1178,7 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1177
1178
|
}, {
|
|
1178
1179
|
key: "addEventListener",
|
|
1179
1180
|
value: function addEventListener(type, listener) {
|
|
1180
|
-
(
|
|
1181
|
+
_superPropGet(CameraControls, "addEventListener", this, 3)([type, listener]);
|
|
1181
1182
|
}
|
|
1182
1183
|
/**
|
|
1183
1184
|
* Removes the specified event listener
|
|
@@ -1192,7 +1193,7 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1192
1193
|
}, {
|
|
1193
1194
|
key: "removeEventListener",
|
|
1194
1195
|
value: function removeEventListener(type, listener) {
|
|
1195
|
-
(
|
|
1196
|
+
_superPropGet(CameraControls, "removeEventListener", this, 3)([type, listener]);
|
|
1196
1197
|
}
|
|
1197
1198
|
/**
|
|
1198
1199
|
* Rotate azimuthal angle(horizontal) and polar angle(vertical).
|
|
@@ -2580,4 +2581,5 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2580
2581
|
return boundingSphere;
|
|
2581
2582
|
}
|
|
2582
2583
|
}]);
|
|
2583
|
-
}(EventDispatcher);
|
|
2584
|
+
}(EventDispatcher);
|
|
2585
|
+
export { EventDispatcher, CameraControls as default };
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
6
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
-
var _viewer3d = _interopRequireDefault(require("./viewer3d"));
|
|
8
|
-
var _state3D = _interopRequireDefault(require("./ruler-utils/state3D"));
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import Viewer3D from "./viewer3d";
|
|
4
|
+
import State3D from "./ruler-utils/state3D";
|
|
9
5
|
var k = 0;
|
|
10
|
-
function Front3D(_ref, _ref2) {
|
|
6
|
+
export default function Front3D(_ref, _ref2) {
|
|
11
7
|
var width = _ref.width,
|
|
12
8
|
height = _ref.height,
|
|
13
9
|
state = _ref.state,
|
|
@@ -16,8 +12,8 @@ function Front3D(_ref, _ref2) {
|
|
|
16
12
|
keyDownEnable = _ref.keyDownEnable,
|
|
17
13
|
catalog = _ref.catalog;
|
|
18
14
|
var viewer2DActions = _ref2.viewer2DActions;
|
|
19
|
-
var _useState =
|
|
20
|
-
_useState2 = (
|
|
15
|
+
var _useState = useState(''),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
17
|
mode = _useState2[0],
|
|
22
18
|
setMode = _useState2[1];
|
|
23
19
|
var sceneWidth = width;
|
|
@@ -29,13 +25,13 @@ function Front3D(_ref, _ref2) {
|
|
|
29
25
|
var mouseUpEvent = function mouseUpEvent(event) {
|
|
30
26
|
setToolbar('');
|
|
31
27
|
};
|
|
32
|
-
|
|
28
|
+
useEffect(function () {
|
|
33
29
|
document.getElementById('front').addEventListener('mouseup', mouseUpEvent);
|
|
34
30
|
return function () {
|
|
35
31
|
document.getElementById('front').removeEventListener('mouseup', mouseUpEvent);
|
|
36
32
|
};
|
|
37
33
|
}, []);
|
|
38
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("svg", {
|
|
39
35
|
width: sceneWidth,
|
|
40
36
|
height: sceneHeight,
|
|
41
37
|
id: "front",
|
|
@@ -43,15 +39,15 @@ function Front3D(_ref, _ref2) {
|
|
|
43
39
|
position: 'absolute',
|
|
44
40
|
display: 'block'
|
|
45
41
|
}
|
|
46
|
-
}, /*#__PURE__*/
|
|
42
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
47
43
|
transform: "translate(".concat(width / 2, ", ").concat(height / 2, ")")
|
|
48
|
-
}, /*#__PURE__*/
|
|
44
|
+
}, /*#__PURE__*/React.createElement(State3D, {
|
|
49
45
|
state: state,
|
|
50
46
|
catalog: catalog,
|
|
51
47
|
height: sceneHeight,
|
|
52
48
|
width: sceneWidth,
|
|
53
49
|
downloadFlag: false
|
|
54
|
-
}))), /*#__PURE__*/
|
|
50
|
+
}))), /*#__PURE__*/React.createElement(Viewer3D, {
|
|
55
51
|
id: "viewer3D",
|
|
56
52
|
key: k,
|
|
57
53
|
state: state,
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _helvetiker_regularTypeface = require("./libs/helvetiker_regular.typeface.js");
|
|
7
|
-
var _gridStreak = _interopRequireDefault(require("./grids/grid-streak"));
|
|
8
|
-
var _FontLoader = require("three/examples/jsm/loaders/FontLoader.js");
|
|
9
|
-
function createGrid(scene) {
|
|
1
|
+
import * as Three from 'three';
|
|
2
|
+
import { HELVETIKER } from "./libs/helvetiker_regular.typeface.js";
|
|
3
|
+
import gridStreak from "./grids/grid-streak";
|
|
4
|
+
import { FontLoader } from 'three/examples/jsm/loaders/FontLoader.js';
|
|
5
|
+
export default function createGrid(scene) {
|
|
10
6
|
var gridMesh = new Three.Object3D();
|
|
11
7
|
gridMesh.name = 'grid';
|
|
12
|
-
var fontLoader = new
|
|
13
|
-
var font = fontLoader.parse(
|
|
8
|
+
var fontLoader = new FontLoader();
|
|
9
|
+
var font = fontLoader.parse(HELVETIKER); // For measures
|
|
14
10
|
var grids = scene.grids,
|
|
15
11
|
width = scene.width,
|
|
16
12
|
height = scene.height;
|
|
17
13
|
grids.forEach(function (grid) {
|
|
18
14
|
switch (grid.type) {
|
|
19
15
|
case 'horizontal-streak':
|
|
20
|
-
gridMesh.add((
|
|
16
|
+
gridMesh.add(gridStreak(width, height, grid, font));
|
|
21
17
|
break;
|
|
22
18
|
default:
|
|
23
19
|
break;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _immutable = require("immutable");
|
|
6
|
-
var _sharedStyle = require("../../../shared-style");
|
|
7
|
-
function _default(width, height, grid, font) {
|
|
1
|
+
import * as Three from 'three';
|
|
2
|
+
import { List } from 'immutable';
|
|
3
|
+
import { COLORS } from "../../../shared-style";
|
|
4
|
+
export default function (width, height, grid, font) {
|
|
8
5
|
var step = grid.properties.get('step');
|
|
9
|
-
var colors = grid.properties.has('color') ? new
|
|
6
|
+
var colors = grid.properties.has('color') ? new List([grid.properties.get('color')]) : grid.properties.get('colors');
|
|
10
7
|
var streak = new Three.Object3D();
|
|
11
8
|
streak.name = 'streak';
|
|
12
9
|
var counter = 0;
|
|
@@ -25,7 +22,7 @@ function _default(width, height, grid, font) {
|
|
|
25
22
|
font: font
|
|
26
23
|
});
|
|
27
24
|
var wrapper = new Three.MeshBasicMaterial({
|
|
28
|
-
color:
|
|
25
|
+
color: COLORS.black
|
|
29
26
|
});
|
|
30
27
|
var words = new Three.Mesh(shape, wrapper);
|
|
31
28
|
words.rotation.x -= Math.PI / 2;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _immutable = require("immutable");
|
|
6
|
-
var _sharedStyle = require("../../../shared-style");
|
|
7
|
-
function _default(width, height, grid, font) {
|
|
1
|
+
import * as Three from 'three';
|
|
2
|
+
import { List } from 'immutable';
|
|
3
|
+
import { COLORS } from "../../../shared-style";
|
|
4
|
+
export default function (width, height, grid, font) {
|
|
8
5
|
var step = grid.properties.get('step');
|
|
9
|
-
var colors = grid.properties.has('color') ? new
|
|
6
|
+
var colors = grid.properties.has('color') ? new List([grid.properties.get('color')]) : grid.properties.get('colors');
|
|
10
7
|
var streak = new Three.Object3D();
|
|
11
8
|
streak.name = 'streak';
|
|
12
9
|
var counter = 0;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _immutable = require("immutable");
|
|
6
|
-
var _sharedStyle = require("../../../shared-style");
|
|
7
|
-
function _default(width, height, grid, font) {
|
|
1
|
+
import * as Three from 'three';
|
|
2
|
+
import { List } from 'immutable';
|
|
3
|
+
import { COLORS } from "../../../shared-style";
|
|
4
|
+
export default function (width, height, grid, font) {
|
|
8
5
|
var step = grid.properties.get('step');
|
|
9
|
-
var colors = grid.properties.has('color') ? new
|
|
6
|
+
var colors = grid.properties.has('color') ? new List([grid.properties.get('color')]) : grid.properties.get('colors');
|
|
10
7
|
var streak = new Three.Object3D();
|
|
11
8
|
streak.name = 'streak';
|
|
12
9
|
var counter = 0;
|
|
@@ -25,7 +22,7 @@ function _default(width, height, grid, font) {
|
|
|
25
22
|
font: font
|
|
26
23
|
});
|
|
27
24
|
var wrapper = new Three.MeshBasicMaterial({
|
|
28
|
-
color:
|
|
25
|
+
color: COLORS.black
|
|
29
26
|
});
|
|
30
27
|
var words = new Three.Mesh(shape, wrapper);
|
|
31
28
|
words.rotation.x -= Math.PI / 2;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
exports.firstPersonOnKeyDown = firstPersonOnKeyDown;
|
|
3
|
-
exports.firstPersonOnKeyUp = firstPersonOnKeyUp;
|
|
4
|
-
function firstPersonOnKeyDown(event, moveForward, moveLeft, moveBackward, moveRight, canJump, velocity) {
|
|
1
|
+
export function firstPersonOnKeyDown(event, moveForward, moveLeft, moveBackward, moveRight, canJump, velocity) {
|
|
5
2
|
switch (event.keyCode) {
|
|
6
3
|
case 38: // up
|
|
7
4
|
case 87:
|
|
@@ -37,7 +34,7 @@ function firstPersonOnKeyDown(event, moveForward, moveLeft, moveBackward, moveRi
|
|
|
37
34
|
canJump: canJump
|
|
38
35
|
};
|
|
39
36
|
}
|
|
40
|
-
function firstPersonOnKeyUp(event, moveForward, moveLeft, moveBackward, moveRight, canJump) {
|
|
37
|
+
export function firstPersonOnKeyUp(event, moveForward, moveLeft, moveBackward, moveRight, canJump) {
|
|
41
38
|
switch (event.keyCode) {
|
|
42
39
|
case 38: // up
|
|
43
40
|
case 87:
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
exports.__esModule = true;
|
|
2
|
-
exports["default"] = void 0;
|
|
3
1
|
/**
|
|
4
2
|
* Loads a Wavefront .mtl file specifying materials
|
|
5
3
|
*
|
|
@@ -356,4 +354,4 @@ MTLLoader.MaterialCreator.prototype = {
|
|
|
356
354
|
return texture;
|
|
357
355
|
}
|
|
358
356
|
};
|
|
359
|
-
|
|
357
|
+
export default MTLLoader;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
exports.__esModule = true;
|
|
2
|
-
exports["default"] = void 0;
|
|
3
1
|
/**
|
|
4
2
|
* @author mrdoob / http://mrdoob.com/
|
|
5
3
|
*/
|
|
@@ -461,4 +459,4 @@ OBJLoader.prototype = {
|
|
|
461
459
|
return container;
|
|
462
460
|
}
|
|
463
461
|
};
|
|
464
|
-
|
|
462
|
+
export default OBJLoader;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
exports.__esModule = true;
|
|
2
|
-
exports.OrbitControls = OrbitControls;
|
|
3
|
-
exports["default"] = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @author qiao / https://github.com/qiao
|
|
6
3
|
* @author mrdoob / http://mrdoob.com
|
|
@@ -698,4 +695,5 @@ Object.defineProperties(OrbitControls.prototype, {
|
|
|
698
695
|
}
|
|
699
696
|
}
|
|
700
697
|
});
|
|
701
|
-
|
|
698
|
+
export default OrbitControls;
|
|
699
|
+
export { OrbitControls };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
exports.__esModule = true;
|
|
2
|
-
exports.PointerLockControls = PointerLockControls;
|
|
3
|
-
exports["default"] = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @author mrdoob / http://mrdoob.com/
|
|
6
3
|
*/
|
|
@@ -45,4 +42,5 @@ function PointerLockControls(camera) {
|
|
|
45
42
|
};
|
|
46
43
|
}();
|
|
47
44
|
}
|
|
48
|
-
|
|
45
|
+
export default PointerLockControls;
|
|
46
|
+
export { PointerLockControls };
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.initPointerLock = initPointerLock;
|
|
4
|
-
var _pointerLockControls = _interopRequireDefault(require("./libs/pointer-lock-controls"));
|
|
5
|
-
function initPointerLock(camera, rendererElement) {
|
|
1
|
+
import PointerLockControls from "./libs/pointer-lock-controls";
|
|
2
|
+
export function initPointerLock(camera, rendererElement) {
|
|
6
3
|
var havePointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document;
|
|
7
4
|
var pointerlockchange = function pointerlockchange(event) {
|
|
8
5
|
controls.enabled = !controls.enabled;
|
|
@@ -19,7 +16,7 @@ function initPointerLock(camera, rendererElement) {
|
|
|
19
16
|
} else {
|
|
20
17
|
console.log("Your browser doesn't seem to support Pointer Lock API");
|
|
21
18
|
}
|
|
22
|
-
var controls = new
|
|
19
|
+
var controls = new PointerLockControls(camera);
|
|
23
20
|
return {
|
|
24
21
|
controls: controls,
|
|
25
22
|
pointerlockChangeEvent: pointerlockchange,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _constants = require("../../../constants");
|
|
6
|
-
var _convertUnitsLite = require("../../../utils/convert-units-lite");
|
|
7
|
-
function ItemRect(_ref) {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MODE_BACK_ELEVATION_VIEW, MODE_FRONT_ELEVATION_VIEW, MODE_LEFT_ELEVATION_VIEW, MODE_RIGHT_ELEVATION_VIEW } from "../../../constants";
|
|
3
|
+
import { convert } from "../../../utils/convert-units-lite";
|
|
4
|
+
export default function ItemRect(_ref) {
|
|
8
5
|
var scene = _ref.scene,
|
|
9
6
|
layer = _ref.layer,
|
|
10
7
|
calcrect = _ref.calcrect,
|
|
@@ -19,46 +16,46 @@ function ItemRect(_ref) {
|
|
|
19
16
|
y0 = v0.y;
|
|
20
17
|
var x1 = v1.x,
|
|
21
18
|
y1 = v1.y;
|
|
22
|
-
var translateY = frontRect.height / 2 -
|
|
19
|
+
var translateY = frontRect.height / 2 - convert(Math.abs(calcrect.itemInfo.properties.altitude._length)).from(calcrect.itemInfo.properties.altitude._unit).to(layer.unit) * scale;
|
|
23
20
|
var translateX = -frontRect.width / 2;
|
|
24
|
-
var itemWidth =
|
|
25
|
-
var itemDepth =
|
|
26
|
-
var itemHeight =
|
|
21
|
+
var itemWidth = convert(calcrect.size.width).from(scene.unit).to(layer.unit) * scale;
|
|
22
|
+
var itemDepth = convert(calcrect.size.depth).from(scene.unit).to(layer.unit) * scale;
|
|
23
|
+
var itemHeight = convert(calcrect.size.height).from(scene.unit).to(layer.unit) * scale;
|
|
27
24
|
switch (mode) {
|
|
28
|
-
case
|
|
29
|
-
case
|
|
30
|
-
translateX +=
|
|
25
|
+
case MODE_FRONT_ELEVATION_VIEW:
|
|
26
|
+
case MODE_BACK_ELEVATION_VIEW:
|
|
27
|
+
translateX += convert(Math.abs(rect[3].x - x0)).from(scene.unit).to(layer.unit) * scale;
|
|
31
28
|
break;
|
|
32
|
-
case
|
|
33
|
-
case
|
|
34
|
-
translateX +=
|
|
29
|
+
case MODE_RIGHT_ELEVATION_VIEW:
|
|
30
|
+
case MODE_LEFT_ELEVATION_VIEW:
|
|
31
|
+
translateX += convert(Math.abs(rect[3].y - y1)).from(scene.unit).to(layer.unit) * scale;
|
|
35
32
|
break;
|
|
36
33
|
}
|
|
37
34
|
var dimension;
|
|
38
35
|
switch (sideFlag) {
|
|
39
36
|
case 0:
|
|
40
|
-
dimension = /*#__PURE__*/
|
|
37
|
+
dimension = /*#__PURE__*/React.createElement("polygon", {
|
|
41
38
|
points: "0,0 0,-".concat(itemHeight, " ").concat(itemWidth, ",-").concat(itemHeight, " ").concat(itemWidth, ",0"),
|
|
42
39
|
fill: "none",
|
|
43
40
|
stroke: "black"
|
|
44
41
|
});
|
|
45
42
|
break;
|
|
46
43
|
case 1:
|
|
47
|
-
dimension = /*#__PURE__*/
|
|
44
|
+
dimension = /*#__PURE__*/React.createElement("polygon", {
|
|
48
45
|
points: "0,0 0,-".concat(itemHeight, " ").concat(itemDepth, ",-").concat(itemHeight, " ").concat(itemDepth, ",0"),
|
|
49
46
|
fill: "none",
|
|
50
47
|
stroke: "black"
|
|
51
48
|
});
|
|
52
49
|
break;
|
|
53
50
|
case 2:
|
|
54
|
-
dimension = /*#__PURE__*/
|
|
51
|
+
dimension = /*#__PURE__*/React.createElement("polygon", {
|
|
55
52
|
points: "0,0 0,-".concat(itemHeight, " -").concat(itemDepth, ",-").concat(itemHeight, " -").concat(itemDepth, ",0"),
|
|
56
53
|
fill: "none",
|
|
57
54
|
stroke: "black"
|
|
58
55
|
});
|
|
59
56
|
break;
|
|
60
57
|
}
|
|
61
|
-
return /*#__PURE__*/
|
|
58
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
62
59
|
transform: "translate(".concat(translateX, ", ").concat(translateY, ")")
|
|
63
60
|
}, dimension);
|
|
64
61
|
}
|