hart-estate-widget 0.0.27 → 0.0.30
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.
@@ -111,8 +111,8 @@ const setPanoramaLinks = (json, currentRoom, center, panorama, panoramas) => {
|
|
111
111
|
return room_id === connectedRoom.ID;
|
112
112
|
});
|
113
113
|
if (!connectedPanorama) return;
|
114
|
-
const locationX = Location.
|
115
|
-
const locationY =
|
114
|
+
const locationX = Location.Y - center[1];
|
115
|
+
const locationY = Location.X - center[0];
|
116
116
|
const defaultScale = 20;
|
117
117
|
const maxScale = 50;
|
118
118
|
const defaultLength = 120;
|
@@ -206,12 +206,30 @@ const PanoramaTab = _ref3 => {
|
|
206
206
|
};
|
207
207
|
|
208
208
|
(0, _react.useEffect)(() => {
|
209
|
+
const container = document.querySelector('.widget-tab__panorama-overlay');
|
209
210
|
const newViewer = new PANOLENS.Viewer({
|
210
|
-
container
|
211
|
+
container,
|
211
212
|
autoHideInfospot: false,
|
212
213
|
controlButtons: [],
|
213
214
|
cameraFov: 90
|
214
215
|
});
|
216
|
+
container.addEventListener('mousewheel', e => {
|
217
|
+
e.preventDefault();
|
218
|
+
e.stopPropagation();
|
219
|
+
const scope = newViewer.getControl();
|
220
|
+
const fovStep = 2;
|
221
|
+
|
222
|
+
if (e.deltaY > 0) {
|
223
|
+
const newFov = scope.object.fov + fovStep;
|
224
|
+
scope.object.fov = newFov < scope.maxFov ? newFov : scope.maxFov;
|
225
|
+
scope.object.updateProjectionMatrix();
|
226
|
+
return;
|
227
|
+
}
|
228
|
+
|
229
|
+
const newFov = scope.object.fov - fovStep;
|
230
|
+
scope.object.fov = newFov > scope.minFov ? newFov : scope.minFov;
|
231
|
+
scope.object.updateProjectionMatrix();
|
232
|
+
});
|
215
233
|
panoramas.forEach(panorama => {
|
216
234
|
if (!panorama.panorama_id) return;
|
217
235
|
panorama.addEventListener('enter', _ref4 => {
|
@@ -222,6 +240,7 @@ const PanoramaTab = _ref3 => {
|
|
222
240
|
});
|
223
241
|
newViewer.add(panorama);
|
224
242
|
});
|
243
|
+
newViewer.scene.rotation.y = Math.PI / 2;
|
225
244
|
setViewer(newViewer);
|
226
245
|
initPanorama();
|
227
246
|
}, [panoramas]);
|
@@ -638,7 +638,7 @@ class HouseStore {
|
|
638
638
|
const modelPath = "".concat(this.apiStore.API_URL, "/storage/furniture/").concat(mesh);
|
639
639
|
const {
|
640
640
|
Location,
|
641
|
-
|
641
|
+
Rotation,
|
642
642
|
Model: ModelName
|
643
643
|
} = furniture;
|
644
644
|
const {
|
@@ -727,7 +727,7 @@ class HouseStore {
|
|
727
727
|
const model = originalModel.clone();
|
728
728
|
model.scale.set(this.sceneScale, this.sceneScale, this.sceneScale);
|
729
729
|
model.position.set(X * this.sceneScale, Y * this.sceneScale, Z * this.sceneScale);
|
730
|
-
model.rotation.set(Math.PI / 2, THREE.Math.degToRad(
|
730
|
+
model.rotation.set(Math.PI / 2, THREE.Math.degToRad(Rotation.Yaw), 0);
|
731
731
|
const loadedTextures = this.loadedTextures[ModelName];
|
732
732
|
|
733
733
|
if (loadedTextures) {
|