Commit ce1fa9a7 authored by Riegel's avatar Riegel
Browse files

Fix eastwards drift while adjusting height

parent 1cec716b
...@@ -5,6 +5,7 @@ import { name, version, mapVersion } from '../package.json'; ...@@ -5,6 +5,7 @@ import { name, version, mapVersion } from '../package.json';
import BIMOptions, { bimOptionsId } from './upload.vue'; import BIMOptions, { bimOptionsId } from './upload.vue';
import objectList, { objectListId } from './objectList.vue'; import objectList, { objectListId } from './objectList.vue';
import scaleControl, { scaleControlId } from './scaleControl.vue'; import scaleControl, { scaleControlId } from './scaleControl.vue';
import * as Cesium from "@vcmap-cesium/engine";
let model; let model;
...@@ -204,8 +205,10 @@ class HeightInteraction extends AbstractInteraction { ...@@ -204,8 +205,10 @@ class HeightInteraction extends AbstractInteraction {
} }
heightDif = heightDif - (dif / 50); heightDif = heightDif - (dif / 50);
let pos = model.position.getValue(); let pos = model.position.getValue();
let cart = Cesium.Cartographic.fromCartesian(pos);
cart.height -= (dif/50);
pos = Cesium.Cartesian3.fromRadians(cart.longitude, cart.latitude, cart.height);
currentMousePosition = [event.windowPosition.x, event.windowPosition.y]; currentMousePosition = [event.windowPosition.x, event.windowPosition.y];
pos.z = pos.z - (dif / 50);
model.position.setValue(pos); model.position.setValue(pos);
} }
return event; return event;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment