Commit 3dcb7242 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

fixed marker dragging over map when tilt and roll are not zeroes

parent 037b0a85
...@@ -441,13 +441,14 @@ function x3dom_translation_v2(x,y,z){ ...@@ -441,13 +441,14 @@ function x3dom_translation_v2(x,y,z){
var at = from.subtract(mat.e2()); var at = from.subtract(mat.e2());
var up = mat.e1(); var up = mat.e1();
var newfrom = delta; // corrections
var R0 = Data.camera.Matrices.R0;
var from_tmp = R0.multMatrixVec(from);
var delta_tmp = R0.multMatrixVec(delta);
// keeping height // keeping height
newfrom.y = from.y; delta_tmp.y = from_tmp.y;
var newfrom = R0.inverse().multMatrixVec(delta_tmp);
var newat = newfrom.subtract(mat.e2()); var newat = newfrom.subtract(mat.e2());
var newmat = x3dom.fields.SFMatrix4f.lookAt(newfrom, newat, up); var newmat = x3dom.fields.SFMatrix4f.lookAt(newfrom, newat, up);
x3dom_setViewpoint(newmat); x3dom_setViewpoint(newmat);
...@@ -456,8 +457,6 @@ function x3dom_translation_v2(x,y,z){ ...@@ -456,8 +457,6 @@ function x3dom_translation_v2(x,y,z){
function x3dom_altelev(alt,elev){ function x3dom_altelev(alt,elev){
console.log("setting elevation");
//x3dom_matrix_test(); //x3dom_matrix_test();
var mat = Scene.element.runtime.viewMatrix().inverse(); var mat = Scene.element.runtime.viewMatrix().inverse();
......
Markdown is supported
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