kitchen-simulator 3.1.12 → 3.1.13

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.
@@ -1,9 +1,9 @@
1
- import * as Three from "three";
2
- import { Box3, Mesh, MeshBasicMaterial, MeshPhysicalMaterial, RepeatWrapping, Shape, TextureLoader, Vector2 } from "three";
1
+ import * as Three from 'three';
2
+ import { Box3, Mesh, MeshBasicMaterial, MeshPhysicalMaterial, RepeatWrapping, Shape, TextureLoader, Vector2 } from 'three';
3
3
  import * as SharedStyle from "../../shared-style";
4
- import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader";
4
+ import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader';
5
5
  var params = {
6
- envMap: "HDR",
6
+ envMap: 'HDR',
7
7
  roughness: 0.9,
8
8
  metalness: 0.8,
9
9
  exposure: 1.0
@@ -58,7 +58,7 @@ var assignUVs = function assignUVs(geometry) {
58
58
  var y3 = position.getY(i + 2);
59
59
  uvArray.push((x1 + offset.x) / range.x, (y1 + offset.y) / range.y, (x2 + offset.x) / range.x, (y2 + offset.y) / range.y, (x3 + offset.x) / range.x, (y3 + offset.y) / range.y);
60
60
  }
61
- geometry.setAttribute("uv", new Three.BufferAttribute(new Float32Array(uvArray), 2));
61
+ geometry.setAttribute('uv', new Three.BufferAttribute(new Float32Array(uvArray), 2));
62
62
  geometry.needsUpdate = true;
63
63
  };
64
64
  export function createArea(element, layer, scene, textures) {
@@ -69,15 +69,15 @@ export function createArea(element, layer, scene, textures) {
69
69
  var texture = element.texture;
70
70
  texture.lengthRepeatScale = 0.01;
71
71
  texture.heightRepeatScale = 0.01;
72
- var color = element.properties.get("patternColor");
72
+ var color = element.properties.get('patternColor');
73
73
  if (element.selected) {
74
74
  color = SharedStyle.AREA_MESH_COLOR.selected;
75
75
  } else {
76
76
  color = SharedStyle.AREA_MESH_COLOR.unselected;
77
77
  }
78
- if (texture.uri === undefined || texture.uri == "") {
78
+ if (texture.uri === undefined || texture.uri == '') {
79
79
  // @todo THIS IS A TEMPORARY FIX TO HAVE A DEFAULT FLOOR TEXTURE
80
- texture.uri = layer.floorStyle.uri || "https://media.test.diydesignspace.com/uploads/CountTop/202203162950_2/texture/oak-barcelona-s.jpg";
80
+ texture.uri = layer.floorStyle.uri || 'https://media.test.diydesignspace.com/uploads/CountTop/202203162950_2/texture/oak-barcelona-s.jpg';
81
81
  }
82
82
  var shape = new Shape();
83
83
  shape.moveTo(vertices[0].x, vertices[0].y);
@@ -85,7 +85,7 @@ export function createArea(element, layer, scene, textures) {
85
85
  shape.lineTo(vertices[i].x, vertices[i].y);
86
86
  }
87
87
  function loadFloorENV() {
88
- return new RGBELoader().load("/assets/Window.hdr", function (texture) {
88
+ return new RGBELoader().load('/assets/Window.hdr', function (texture) {
89
89
  texture.mapping = Three.EquirectangularReflectionMapping;
90
90
  return texture;
91
91
  });
@@ -105,8 +105,8 @@ export function createArea(element, layer, scene, textures) {
105
105
  /* Create holes for the area */
106
106
  element.holes.forEach(function (holeID) {
107
107
  var holeCoords = [];
108
- layer.getIn(["areas", holeID, "vertices"]).forEach(function (vertexID) {
109
- var _layer$getIn = layer.getIn(["vertices", vertexID]),
108
+ layer.getIn(['areas', holeID, 'vertices']).forEach(function (vertexID) {
109
+ var _layer$getIn = layer.getIn(['vertices', vertexID]),
110
110
  x = _layer$getIn.x,
111
111
  y = _layer$getIn.y;
112
112
  holeCoords.push([x, y]);
@@ -133,7 +133,7 @@ export function createArea(element, layer, scene, textures) {
133
133
  var area = new Mesh(shapeGeometry, areaMaterial);
134
134
  area.rotation.x -= Math.PI / 2;
135
135
  area.receiveShadow = true;
136
- area.name = "floor";
136
+ area.name = 'floor';
137
137
  // This mesh is use for creating ceiling mesh
138
138
 
139
139
  var shapeGeometry2 = new Three.ShapeGeometry(shape);
@@ -144,7 +144,7 @@ export function createArea(element, layer, scene, textures) {
144
144
  area2.castShadow = true;
145
145
  area2.rotation.x -= Math.PI / 2;
146
146
  area2.receiveShadow = true;
147
- area2.name = "floorSupport";
147
+ area2.name = 'floorSupport';
148
148
  var floorSupport = area2.clone();
149
149
  area.userData.floorSupport = floorSupport;
150
150
  return Promise.resolve(area);
@@ -154,13 +154,13 @@ export function updatedArea(element, layer, scene, textures, mesh, oldElement, d
154
154
  selfDestroy();
155
155
  return selfBuild();
156
156
  };
157
- var floor = mesh.getObjectByName("floor");
157
+ var floor = mesh.getObjectByName('floor');
158
158
  floor.receiveShadow = true;
159
- if (differences[0] == "selected") {
159
+ if (differences[0] == 'selected') {
160
160
  var color = element.selected ? SharedStyle.AREA_MESH_COLOR.selected : SharedStyle.AREA_MESH_COLOR.unselected;
161
161
  floor.material.color.set(color);
162
- } else if (differences[0] == "properties") {
163
- if (differences[1] === "texture") {
162
+ } else if (differences[0] == 'properties') {
163
+ if (differences[1] === 'texture') {
164
164
  return noPerf();
165
165
  }
166
166
  } else return noPerf();
@@ -4,12 +4,12 @@ import { loadGLTF, scaleObject } from "../../utils/load-obj";
4
4
  import { OBJTYPE_MESH } from "../../../constants";
5
5
  var cached3DWindow = null;
6
6
  export default {
7
- name: 'Clear Window',
7
+ name: 'Window',
8
8
  prototype: 'holes',
9
9
  info: {
10
10
  title: 'Clear',
11
11
  tag: ['window'],
12
- description: 'Clear Window',
12
+ description: 'Window',
13
13
  image: '/assets/img/svg/window/Clear.svg',
14
14
  url: '/assets/gltf/window_clear.gltf'
15
15
  },