kitchen-simulator 5.0.0-new-api → 5.0.0-new-api.2
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/LiteKitchenConfigurator.js +1 -1
- package/es/assets/Window.hdr +2100 -0
- package/es/assets/img/default/maple.jpg +0 -0
- package/es/assets/img/default/steel.jpg +0 -0
- package/es/catalog/catalog.js +0 -2
- package/es/catalog/utils/exporter.js +2 -0
- package/es/class/area.js +0 -1
- package/es/class/export.js +1 -3
- package/es/components/content.js +1 -3
- package/es/components/style/export.js +2 -28
- package/es/components/viewer2d/line.js +2 -2
- package/es/components/viewer2d/viewer2d.js +0 -1
- package/es/components/viewer3d/front3D.js +1 -2
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/es/components/viewer3d/scene-creator.js +7 -5
- package/es/components/viewer3d/three-memory-cleaner.js +0 -14
- package/es/components/viewer3d/viewer3d.js +1 -1
- package/es/constants.js +3 -3
- package/es/devLiteRenderer.js +119 -61
- package/es/events/external/handleExternalEvent.js +140 -0
- package/es/{utils/isolate-event-handler.js → events/external/handleExternalEvent.util.js} +17 -563
- package/es/events/external/handlers.addItem.js +47 -0
- package/es/events/external/handlers.changeDoorStyle.js +131 -0
- package/es/events/external/handlers.elementOps.js +8 -0
- package/es/events/external/handlers.finishing.js +26 -0
- package/es/events/external/handlers.hole.js +4 -0
- package/es/events/external/handlers.loadProject.js +117 -0
- package/es/events/external/handlers.molding.js +24 -0
- package/es/events/external/handlers.projectLifecycle.js +11 -0
- package/es/events/external/handlers.projectSettings.js +32 -0
- package/es/events/external/handlers.replaceCabinet.js +41 -0
- package/es/events/external/handlers.roomShape.js +8 -0
- package/es/events/external/handlers.syncScene.js +21 -0
- package/es/events/external/handlers.updateSelectedElements.js +11 -0
- package/es/events/external/handlers.viewMode.js +11 -0
- package/es/events/external/handlers.viewerNavigation.js +108 -0
- package/es/events/external/handlers.wall.js +7 -0
- package/es/mappings/external-events/mappers/ccdfMapper.js +2 -2
- package/es/mappings/external-events/mappers/changeDoorStyleMapper.js +1 -29
- package/es/plugins/keyboard.js +1 -1
- package/es/reducers/export.js +2 -4
- package/es/reducers/items-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -3
- package/es/shared/objects/immutable.js +3 -0
- package/es/utils/geometry.js +276 -74
- package/es/utils/history.js +2 -2
- package/es/utils/molding.js +6 -20
- package/lib/LiteKitchenConfigurator.js +2 -2
- package/lib/assets/Window.hdr +2100 -0
- package/lib/assets/img/default/maple.jpg +0 -0
- package/lib/assets/img/default/steel.jpg +0 -0
- package/lib/catalog/catalog.js +0 -2
- package/lib/catalog/utils/exporter.js +2 -0
- package/lib/class/area.js +0 -1
- package/lib/class/export.js +0 -8
- package/lib/components/content.js +1 -3
- package/lib/components/style/export.js +1 -105
- package/lib/components/viewer2d/line.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +0 -1
- package/lib/components/viewer3d/front3D.js +1 -2
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/lib/components/viewer3d/scene-creator.js +7 -5
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -14
- package/lib/constants.js +8 -8
- package/lib/devLiteRenderer.js +118 -60
- package/lib/events/external/handleExternalEvent.js +147 -0
- package/lib/{utils/isolate-event-handler.js → events/external/handleExternalEvent.util.js} +14 -557
- package/lib/events/external/handlers.addItem.js +54 -0
- package/lib/events/external/handlers.changeDoorStyle.js +138 -0
- package/lib/events/external/handlers.elementOps.js +15 -0
- package/lib/events/external/handlers.finishing.js +32 -0
- package/lib/events/external/handlers.hole.js +10 -0
- package/lib/events/external/handlers.loadProject.js +124 -0
- package/lib/events/external/handlers.molding.js +31 -0
- package/lib/events/external/handlers.projectLifecycle.js +19 -0
- package/lib/events/external/handlers.projectSettings.js +38 -0
- package/lib/events/external/handlers.replaceCabinet.js +48 -0
- package/lib/events/external/handlers.roomShape.js +14 -0
- package/lib/events/external/handlers.syncScene.js +27 -0
- package/lib/events/external/handlers.updateSelectedElements.js +17 -0
- package/lib/events/external/handlers.viewMode.js +19 -0
- package/lib/events/external/handlers.viewerNavigation.js +117 -0
- package/lib/events/external/handlers.wall.js +13 -0
- package/lib/mappings/external-events/mappers/ccdfMapper.js +2 -2
- package/lib/mappings/external-events/mappers/changeDoorStyleMapper.js +1 -29
- package/lib/reducers/export.js +1 -9
- package/lib/reducers/reducer.js +0 -1
- package/lib/shared/objects/immutable.js +9 -0
- package/lib/utils/geometry.js +276 -74
- package/lib/utils/history.js +1 -1
- package/lib/utils/molding.js +6 -20
- package/package.json +1 -1
- package/es/assets/gltf/door_closet.bin +0 -0
- package/es/assets/gltf/door_closet.fbx +0 -0
- package/es/assets/gltf/door_exterior.bin +0 -0
- package/es/assets/gltf/door_exterior.fbx +0 -0
- package/es/assets/gltf/door_interior.bin +0 -0
- package/es/assets/gltf/door_interior.fbx +0 -0
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/gltf/door_sliding.fbx +0 -0
- package/es/assets/img/png/helper/video_preview_3d.png +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/color/Brown.svg +0 -9
- package/es/assets/img/svg/color/Dark.svg +0 -9
- package/es/assets/img/svg/color/Light.svg +0 -9
- package/es/assets/img/svg/color/Medium.svg +0 -9
- package/es/assets/img/svg/color/Unfinished.svg +0 -9
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -68
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -50
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -100
- package/es/catalog/properties/property-length-measure.js +0 -84
- package/es/catalog/properties/property-length-measure_hole.js +0 -100
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -79
- package/es/class/FuseUtils.js +0 -79
- package/es/components/style/button.js +0 -106
- package/es/components/style/cancel-button.js +0 -21
- package/es/components/style/content-container.js +0 -30
- package/es/components/style/content-title.js +0 -25
- package/es/components/style/delete-button.js +0 -24
- package/es/components/style/form-block.js +0 -20
- package/es/components/style/form-color-input.js +0 -26
- package/es/components/style/form-label.js +0 -22
- package/es/components/style/form-number-input_2.js +0 -200
- package/es/components/style/form-select.js +0 -19
- package/es/components/style/form-slider.js +0 -60
- package/es/components/style/form-text-input.js +0 -69
- package/es/reducers/user-reducer.js +0 -41
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/assets/gltf/door_closet.bin +0 -0
- package/lib/assets/gltf/door_closet.fbx +0 -0
- package/lib/assets/gltf/door_exterior.bin +0 -0
- package/lib/assets/gltf/door_exterior.fbx +0 -0
- package/lib/assets/gltf/door_interior.bin +0 -0
- package/lib/assets/gltf/door_interior.fbx +0 -0
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/gltf/door_sliding.fbx +0 -0
- package/lib/assets/img/png/helper/video_preview_3d.png +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/color/Brown.svg +0 -9
- package/lib/assets/img/svg/color/Dark.svg +0 -9
- package/lib/assets/img/svg/color/Light.svg +0 -9
- package/lib/assets/img/svg/color/Medium.svg +0 -9
- package/lib/assets/img/svg/color/Unfinished.svg +0 -9
- package/lib/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/lib/catalog/properties/export.js +0 -81
- package/lib/catalog/properties/property-checkbox.js +0 -76
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-enum.js +0 -58
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-lenght-measure.js +0 -108
- package/lib/catalog/properties/property-length-measure.js +0 -92
- package/lib/catalog/properties/property-length-measure_hole.js +0 -108
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/catalog/utils/FuseUtils.js +0 -87
- package/lib/class/FuseUtils.js +0 -87
- package/lib/components/style/button.js +0 -115
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -38
- package/lib/components/style/content-title.js +0 -35
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/form-block.js +0 -28
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -30
- package/lib/components/style/form-number-input_2.js +0 -209
- package/lib/components/style/form-select.js +0 -29
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-text-input.js +0 -78
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
|
Binary file
|
|
Binary file
|
package/es/catalog/catalog.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import { PropertyColor, PropertyEnum, PropertyString, PropertyNumber, PropertyLengthMeasure, PropertyToggle, PropertyCheckbox, PropertyHidden, PropertyReadOnly } from "./properties/export";
|
|
5
4
|
import { UNIT_CENTIMETER, UNIT_INCH } from "../constants";
|
|
6
5
|
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
7
6
|
var Catalog = /*#__PURE__*/function () {
|
|
@@ -19,7 +18,6 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
19
18
|
};
|
|
20
19
|
this.propertyTypes = {};
|
|
21
20
|
this.unit = unit;
|
|
22
|
-
this.registerMultiplePropertyType([['color', PropertyColor, PropertyColor], ['enum', PropertyEnum, PropertyEnum], ['string', PropertyString, PropertyString], ['number', PropertyNumber, PropertyNumber], ['length-measure', PropertyLengthMeasure, PropertyLengthMeasure], ['toggle', PropertyToggle, PropertyToggle], ['checkbox', PropertyCheckbox, PropertyCheckbox], ['hidden', PropertyHidden, PropertyHidden], ['read-only', PropertyReadOnly, PropertyReadOnly]]);
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
/**
|
|
@@ -11,6 +11,7 @@ export default function (_ref) {
|
|
|
11
11
|
description = _ref.description,
|
|
12
12
|
prototype = _ref.prototype,
|
|
13
13
|
base = _ref.base,
|
|
14
|
+
gltf = _ref.gltf,
|
|
14
15
|
shape_svg = _ref.shape_svg,
|
|
15
16
|
render2DItem = _ref.render2DItem,
|
|
16
17
|
render3DItem = _ref.render3DItem,
|
|
@@ -100,6 +101,7 @@ export default function (_ref) {
|
|
|
100
101
|
is_corner: is_corner,
|
|
101
102
|
shape_svg: shape_svg
|
|
102
103
|
},
|
|
104
|
+
gltf: gltf,
|
|
103
105
|
properties: _objectSpread(_objectSpread({
|
|
104
106
|
altitude: {
|
|
105
107
|
label: 'Distance from floor',
|
package/es/class/area.js
CHANGED
|
@@ -14,7 +14,6 @@ var Area = /*#__PURE__*/function () {
|
|
|
14
14
|
key: "add",
|
|
15
15
|
value: function add(state, layerID, type, verticesCoords, catalog) {
|
|
16
16
|
var area;
|
|
17
|
-
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
18
17
|
var areaID;
|
|
19
18
|
areaID = IDBroker.acquireID();
|
|
20
19
|
var vertices = verticesCoords.map(function (v) {
|
package/es/class/export.js
CHANGED
|
@@ -6,13 +6,11 @@ import Hole from "./hole";
|
|
|
6
6
|
import Vertex from "./vertex";
|
|
7
7
|
import Area from "./area";
|
|
8
8
|
import Item from "./item";
|
|
9
|
-
import FuseUtils from "./FuseUtils";
|
|
10
9
|
import { HorizontalGuide, VerticalGuide } from "./guide";
|
|
11
|
-
export { Project, Group,
|
|
10
|
+
export { Project, Group, Layer, Line, Hole, Vertex, Area, Item, HorizontalGuide, VerticalGuide };
|
|
12
11
|
export default {
|
|
13
12
|
Project: Project,
|
|
14
13
|
Group: Group,
|
|
15
|
-
FuseUtils: FuseUtils,
|
|
16
14
|
Layer: Layer,
|
|
17
15
|
Line: Line,
|
|
18
16
|
Hole: Hole,
|
package/es/components/content.js
CHANGED
|
@@ -7,18 +7,16 @@ import Viewer3DFirstPerson from "./viewer3d/viewer3d-first-person";
|
|
|
7
7
|
// import ProjectConfigurator from './configurator/project-configurator';
|
|
8
8
|
import * as constants from "../constants";
|
|
9
9
|
import Front3D from "./viewer3d/front3D";
|
|
10
|
-
export default function Content(_ref
|
|
10
|
+
export default function Content(_ref) {
|
|
11
11
|
var width = _ref.width,
|
|
12
12
|
height = _ref.height,
|
|
13
13
|
state = _ref.state,
|
|
14
14
|
customContents = _ref.customContents,
|
|
15
|
-
match = _ref.match,
|
|
16
15
|
setToolbar = _ref.setToolbar,
|
|
17
16
|
replaceCabinet = _ref.replaceCabinet,
|
|
18
17
|
keyDownEnable = _ref.keyDownEnable,
|
|
19
18
|
catalog = _ref.catalog,
|
|
20
19
|
onInternalEvent = _ref.onInternalEvent;
|
|
21
|
-
var projectActions = _ref2.projectActions;
|
|
22
20
|
var mode = state.get('mode');
|
|
23
21
|
|
|
24
22
|
// Internal Event for unselect_all
|
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
import Button from "./button";
|
|
2
|
-
import CancelButton from "./cancel-button";
|
|
3
|
-
import ContentContainer from "./content-container";
|
|
4
|
-
import ContentTitle from "./content-title";
|
|
5
|
-
import DeleteButton from "./delete-button";
|
|
6
|
-
import FormBlock from "./form-block";
|
|
7
|
-
import FormColorInput from "./form-color-input";
|
|
8
|
-
import FormLabel from "./form-label";
|
|
9
1
|
import FormNumberInput from "./form-number-input";
|
|
10
|
-
|
|
11
|
-
import FormSlider from "./form-slider";
|
|
12
|
-
import FormSubmitButton from "./form-submit-button";
|
|
13
|
-
import FormTextInput from "./form-text-input";
|
|
14
|
-
import FormNumberInput2 from "./form-number-input_2";
|
|
15
|
-
export { Button, CancelButton, ContentContainer, ContentTitle, DeleteButton, FormBlock, FormColorInput, FormLabel, FormNumberInput, FormSelect, FormSlider, FormSubmitButton, FormTextInput, FormNumberInput2 };
|
|
2
|
+
export { FormNumberInput };
|
|
16
3
|
export default {
|
|
17
|
-
|
|
18
|
-
CancelButton: CancelButton,
|
|
19
|
-
ContentContainer: ContentContainer,
|
|
20
|
-
ContentTitle: ContentTitle,
|
|
21
|
-
DeleteButton: DeleteButton,
|
|
22
|
-
FormBlock: FormBlock,
|
|
23
|
-
FormColorInput: FormColorInput,
|
|
24
|
-
FormLabel: FormLabel,
|
|
25
|
-
FormNumberInput: FormNumberInput,
|
|
26
|
-
FormSelect: FormSelect,
|
|
27
|
-
FormSlider: FormSlider,
|
|
28
|
-
FormSubmitButton: FormSubmitButton,
|
|
29
|
-
FormTextInput: FormTextInput,
|
|
30
|
-
FormNumberInput2: FormNumberInput2
|
|
4
|
+
FormNumberInput: FormNumberInput
|
|
31
5
|
};
|
|
@@ -5,7 +5,7 @@ import React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { GeometryUtils } from "../../utils/export";
|
|
7
7
|
import Ruler from "./ruler";
|
|
8
|
-
import { BASE_CABINET_LAYOUTPOS, LINE_THICKNESS, MODE_DRAGGING_LINE, MODE_DRAWING_LINE, WALL_CABINET_LAYOUTPOS, MAX_ANGLE_SCALE, ROOM_SHAPE_MEASUREMENT_LINE_COLOR, ROOM_ELEMENT_MEASUREMENT_LINE_COLOR, BASE_ITEM_MEASUREMENT_LINE_COLOR, WALL_ITEM_MEASUREMENT_LINE_COLOR, DISTANCE_MEASUREMENT_LINE_COLOR, DASH_LINE_COLOR, TALL_CABINET_LAYOUTPOS, VANITY_CABINET_LAYOUTPOS } from "../../constants";
|
|
8
|
+
import { BASE_CABINET_LAYOUTPOS, LINE_THICKNESS, MODE_DRAGGING_LINE, MODE_DRAWING_LINE, WALL_CABINET_LAYOUTPOS, MAX_ANGLE_SCALE, ROOM_SHAPE_MEASUREMENT_LINE_COLOR, ROOM_ELEMENT_MEASUREMENT_LINE_COLOR, BASE_ITEM_MEASUREMENT_LINE_COLOR, WALL_ITEM_MEASUREMENT_LINE_COLOR, DISTANCE_MEASUREMENT_LINE_COLOR, DASH_LINE_COLOR, TALL_CABINET_LAYOUTPOS, VANITY_CABINET_LAYOUTPOS, ACCESSORIES_LAYOUTPOS } from "../../constants";
|
|
9
9
|
import * as Three from 'three';
|
|
10
10
|
import { isEmpty } from "./utils";
|
|
11
11
|
var STYLE = {
|
|
@@ -395,7 +395,7 @@ export default function Line(_ref) {
|
|
|
395
395
|
|
|
396
396
|
//base cabinet
|
|
397
397
|
var baseSpace = wallSpace + STEP;
|
|
398
|
-
var base_item = GeometryUtils.getAllItemSpecified(scene, catalog, [BASE_CABINET_LAYOUTPOS, VANITY_CABINET_LAYOUTPOS]);
|
|
398
|
+
var base_item = GeometryUtils.getAllItemSpecified(scene, catalog, [BASE_CABINET_LAYOUTPOS, VANITY_CABINET_LAYOUTPOS, ACCESSORIES_LAYOUTPOS]);
|
|
399
399
|
|
|
400
400
|
// base cabinet
|
|
401
401
|
var baseRuler = [];
|
|
@@ -4,7 +4,7 @@ import Viewer3D from "./viewer3d";
|
|
|
4
4
|
import State3D from "./ruler-utils/state3D";
|
|
5
5
|
import { isEmpty } from "../viewer2d/utils";
|
|
6
6
|
var k = 0;
|
|
7
|
-
export default function Front3D(_ref
|
|
7
|
+
export default function Front3D(_ref) {
|
|
8
8
|
var width = _ref.width,
|
|
9
9
|
height = _ref.height,
|
|
10
10
|
state = _ref.state,
|
|
@@ -12,7 +12,6 @@ export default function Front3D(_ref, _ref2) {
|
|
|
12
12
|
replaceCabinet = _ref.replaceCabinet,
|
|
13
13
|
keyDownEnable = _ref.keyDownEnable,
|
|
14
14
|
catalog = _ref.catalog;
|
|
15
|
-
var viewer2DActions = _ref2.viewer2DActions;
|
|
16
15
|
var _useState = useState(''),
|
|
17
16
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18
17
|
mode = _useState2[0],
|
|
@@ -22,94 +22,4 @@ export function initPointerLock(camera, rendererElement) {
|
|
|
22
22
|
pointerlockChangeEvent: pointerlockchange,
|
|
23
23
|
requestPointerLockEvent: requestPointerLockEvent
|
|
24
24
|
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* Funzione per il calcolo delle collisioni con gli oggetti contenuti all'interno di un array.
|
|
28
|
-
* L'idea è quella di utilizzare il ray casting. Per tenere conto del fatto che ci possiamo
|
|
29
|
-
* muovere nelle quattro direzioni, applico una matrice di rotazione alla direzione verso la
|
|
30
|
-
* quale l'oggetto del pointer lock è orientato. */
|
|
31
|
-
|
|
32
|
-
function collision(controls, collisionArray) {
|
|
33
|
-
var rotationMatrix;
|
|
34
|
-
var cameraDirection = controls.getDirection(new THREE.Vector3(0, 0, 0)).clone();
|
|
35
|
-
if (controls.moveForward()) {
|
|
36
|
-
// Nothing to do!
|
|
37
|
-
} else if (controls.moveBackward()) {
|
|
38
|
-
rotationMatrix = new THREE.Matrix4();
|
|
39
|
-
rotationMatrix.makeRotationY(180 * Math.PI / 180);
|
|
40
|
-
} else if (controls.moveLeft()) {
|
|
41
|
-
rotationMatrix = new THREE.Matrix4();
|
|
42
|
-
rotationMatrix.makeRotationY(90 * Math.PI / 180);
|
|
43
|
-
} else if (controls.moveRight()) {
|
|
44
|
-
rotationMatrix = new THREE.Matrix4();
|
|
45
|
-
rotationMatrix.makeRotationY((360 - 90) * Math.PI / 180);
|
|
46
|
-
} else return;
|
|
47
|
-
if (rotationMatrix !== undefined) {
|
|
48
|
-
cameraDirection.applyMatrix4(rotationMatrix);
|
|
49
|
-
}
|
|
50
|
-
var rayCaster = new THREE.Raycaster(controls.getObject().position, cameraDirection.normalize());
|
|
51
|
-
var intersects = rayCaster.intersectObjects(collisionArray, true);
|
|
52
|
-
if (intersects.length > 0 && intersects[0].distance < 10) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* Funzione meno raffinata per il calcolo delle collisioni.
|
|
59
|
-
* In pratica viene definita una bounding geometry (in questo caso la skymap) e poi vengono fatti
|
|
60
|
-
* partire una serie di raggi dall'object del controller fino ai vertici di questa geometria. Se uno di questi interseca
|
|
61
|
-
* uno degli oggetti dei quali vogliamo controllare la collisione, allora la funzione restituirà il valore true */
|
|
62
|
-
/*
|
|
63
|
-
function collision(object, boundingGeometry, collisionArray ) {
|
|
64
|
-
|
|
65
|
-
for (let vertexIndex = 0; vertexIndex < boundingGeometry.geometry.vertices.length; vertexIndex++) {
|
|
66
|
-
let localVertex = boundingGeometry.geometry.vertices[vertexIndex].clone();
|
|
67
|
-
let globalVertex = localVertex.applyMatrix4( object.matrix );
|
|
68
|
-
let directionVector = globalVertex.sub( object.position );
|
|
69
|
-
|
|
70
|
-
let ray = new THREE.Raycaster(object.position, directionVector.clone().normalize());
|
|
71
|
-
let collisionResults = ray.intersectObjects(collisionArray, true);
|
|
72
|
-
if (collisionResults.length > 0 && collisionResults[0].distance < directionVector.length() - 1293) {
|
|
73
|
-
console.log("collisione: ",collisionResults[0].distance," ",directionVector.length()-1293);
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
*/
|
|
80
|
-
|
|
81
|
-
/* Questa funzione si occupa di determinare se il controllo si trova su un oggetto, in caso negativo cade verso il basso
|
|
82
|
-
* (vedi esempio pointer lock) */
|
|
83
|
-
|
|
84
|
-
function translateY(controls, ray, objects) {
|
|
85
|
-
controls.isOnObject(false);
|
|
86
|
-
ray.ray.origin.copy(controls.getObject().position);
|
|
87
|
-
ray.ray.origin.y -= 10;
|
|
88
|
-
var intersections = ray.intersectObjects(objects, true);
|
|
89
|
-
if (intersections.length > 0) {
|
|
90
|
-
var distance = intersections[0].distance;
|
|
91
|
-
if (distance > 0 && distance < 10) {
|
|
92
|
-
controls.isOnObject(true);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/* Queste funzioni bloccano o sbloccano il movimento del controller (utili in caso di collisione) */
|
|
98
|
-
|
|
99
|
-
function lockDirection(controls) {
|
|
100
|
-
if (controls.moveForward()) {
|
|
101
|
-
controls.lockMoveForward(true);
|
|
102
|
-
} else if (controls.moveBackward()) {
|
|
103
|
-
controls.lockMoveBackward(true);
|
|
104
|
-
} else if (controls.moveLeft()) {
|
|
105
|
-
controls.lockMoveLeft(true);
|
|
106
|
-
} else if (controls.moveRight()) {
|
|
107
|
-
controls.lockMoveRight(true);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function unlockAllDirection(controls) {
|
|
111
|
-
controls.lockMoveForward(false);
|
|
112
|
-
controls.lockMoveBackward(false);
|
|
113
|
-
controls.lockMoveLeft(false);
|
|
114
|
-
controls.lockMoveRight(false);
|
|
115
25
|
}
|
|
@@ -15,7 +15,6 @@ import { loadTexture } from "../../catalog/utils/item-loader";
|
|
|
15
15
|
import { returnReplaceableDeepSearchType } from "../viewer2d/utils";
|
|
16
16
|
import { animateDoor, isElevationView, isEmpty, isImmutable, replaceMeshesWithLineSegments, translateDrawer } from "../../utils/helper";
|
|
17
17
|
import { formatNumber } from "../../utils/math";
|
|
18
|
-
var transformBox;
|
|
19
18
|
export var fVLine = [];
|
|
20
19
|
var scene_mode = null;
|
|
21
20
|
export function parseData(sceneData, actions, catalog, camera, renderer, mode) {
|
|
@@ -2065,10 +2064,13 @@ function addItem(sceneData, planData, layer, itemID, catalog, itemsActions) {
|
|
|
2065
2064
|
}
|
|
2066
2065
|
}
|
|
2067
2066
|
}
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2067
|
+
|
|
2068
|
+
// if (item.selected) {
|
|
2069
|
+
// let tranformControl = item3D.children[item3D.children.length - 1];
|
|
2070
|
+
// transformBox =
|
|
2071
|
+
// tranformControl.children[tranformControl.children.length - 1];
|
|
2072
|
+
// }
|
|
2073
|
+
|
|
2072
2074
|
pivot.rotation.y = item.rotation * Math.PI / 180 + Math.PI;
|
|
2073
2075
|
// pivot.rotation.y = item.rotation;
|
|
2074
2076
|
pivot.position.x = item.x;
|
|
@@ -2,20 +2,6 @@ import * as Three from 'three';
|
|
|
2
2
|
function disposeGeometry(geometry) {
|
|
3
3
|
geometry.dispose();
|
|
4
4
|
}
|
|
5
|
-
function disposeTexture(texture) {
|
|
6
|
-
if (!texture) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
texture.dispose();
|
|
10
|
-
}
|
|
11
|
-
function disposeMultimaterial(material) {
|
|
12
|
-
if (!(material.isMaterial && !Array.isArray(material))) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
material.materials.forEach(function (material) {
|
|
16
|
-
disposeMaterial(material);
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
5
|
function disposeMaterial(material) {
|
|
20
6
|
if (!(material instanceof Three.Material)) {
|
|
21
7
|
return;
|
|
@@ -19,7 +19,7 @@ import { checkCabinetOverlap, createBacksplash, deleteSpecifiedMeshObjects, fVLi
|
|
|
19
19
|
import { disposeObject, disposeScene } from "./three-memory-cleaner";
|
|
20
20
|
import diff from 'immutablediff';
|
|
21
21
|
import * as SharedStyle from "../../shared-style";
|
|
22
|
-
import { BASE_CABINET_LAYOUTPOS, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_HOLE_3D, MODE_DRAWING_ITEM_3D, MODE_ELEVATION_VIEW, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, SECONDARY_PURPLE_COLOR, TALL_CABINET_LAYOUTPOS, UNIT_CENTIMETER, WALL_CABINET_LAYOUTPOS, INTERNAL_EVENT_SELECT_ELEMENT, INTERNAL_EVENT_DRAG_ELEMENT, INTERNAL_EVENT_DRAW_ELEMENT, INTERNAL_EVENT_ROTATE_ELEMENT,
|
|
22
|
+
import { BASE_CABINET_LAYOUTPOS, MODE_3D_VIEW, MODE_DRAGGING_ITEM_3D, MODE_DRAWING_HOLE_3D, MODE_DRAWING_ITEM_3D, MODE_ELEVATION_VIEW, MODE_IDLE_3D, MODE_ROTATING_ITEM_3D, SECONDARY_PURPLE_COLOR, TALL_CABINET_LAYOUTPOS, UNIT_CENTIMETER, WALL_CABINET_LAYOUTPOS, INTERNAL_EVENT_SELECT_ELEMENT, INTERNAL_EVENT_DRAG_ELEMENT, INTERNAL_EVENT_DRAW_ELEMENT, INTERNAL_EVENT_ROTATE_ELEMENT, MODE_DRAGGING_HOLE_3D, INTERNAL_EVENT_REPLACE_CABINET } from "../../constants";
|
|
23
23
|
import { isUndefined } from 'util';
|
|
24
24
|
import { verticesDistance } from "../../utils/geometry";
|
|
25
25
|
import { convert } from "../../utils/convert-units-lite";
|
package/es/constants.js
CHANGED
|
@@ -597,6 +597,7 @@ export var BASE_CABINET_LAYOUTPOS = 'Base';
|
|
|
597
597
|
export var WALL_CABINET_LAYOUTPOS = 'Wall';
|
|
598
598
|
export var TALL_CABINET_LAYOUTPOS = 'Tall';
|
|
599
599
|
export var VANITY_CABINET_LAYOUTPOS = 'Vanity';
|
|
600
|
+
export var ACCESSORIES_LAYOUTPOS = 'Accessories';
|
|
600
601
|
export var TOP_MOLDING_LOCATION = 'Top';
|
|
601
602
|
export var MIDDLE_MOLDING_LOCATION = 'Middle';
|
|
602
603
|
export var BOTTOM_MOLDING_LOCATION = 'Bottom';
|
|
@@ -772,8 +773,7 @@ export var DOORSTYLE_SCOPE_ALL = 'all';
|
|
|
772
773
|
export var DOORSTYLE_SCOPE_SINGLE = 'single';
|
|
773
774
|
export var DOORSTYLE_SCOPE_MULTIPLE = 'multiple';
|
|
774
775
|
export var DEFAULT_MOLDING_PIECE_LENGTH = 96; // in inch, 8 feet, standard length for molding pieces
|
|
775
|
-
|
|
776
776
|
// default urls
|
|
777
777
|
|
|
778
|
-
export var DEFAULT_INTERIOR_URL = '
|
|
779
|
-
export var DEFAULT_DOOR_HANDLE_TEXTURE_URL = '
|
|
778
|
+
export var DEFAULT_INTERIOR_URL = '/assets/img/default/maple.jpg';
|
|
779
|
+
export var DEFAULT_DOOR_HANDLE_TEXTURE_URL = '/assets/img/default/steel.jpg';
|