Commit d77d8c25 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

adding marker dragging over shapes... not done

parent 1d739c37
......@@ -15,7 +15,8 @@ var SETTINGS = {
'viewinfo': true,
'moreinfo': true,
'crosshair': false,
'shiftspeed': 0.01
'shiftspeed': 0.01,
'verticaldrag': false
}
$(function(){
......
......@@ -261,6 +261,23 @@ X3DOMObject.Shape.prototype._registerEvents = function(){
$("#sliding_sphere").find("switch").attr("whichChoice",-1);
}
/*
if (!SETTINGS.verticaldrag&&Scene.draggedMarker){
console.log("dragging not vertically");
//$(Scene.draggedMarker) - get id
var sphere = $(Scene.draggedMarker).parent().parent();
console.log(Scene.draggedMarker.parent().parent());
var index = parseInt(sphere.attr("id").substr(7));
console.log(index);
X3DOMObject.Marker.place(x,y,z,"my-sph-"+index);
}
*/
});
......@@ -526,14 +543,6 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
X3DOMObject.Marker.dragStart(this);
//$(this).on('mousemove',x3d_markerDrag);
/*
$(Scene.element).on('mousemove',function(){
console.log("preMouseMove");
x3d_sceneMouseMove2();
},true);
*/
Scene.element.addEventListener('mousemove',X3DOMObject.Marker.mouseMove,true);
Scene.element.addEventListener('mouseup',X3DOMObject.Marker.mouseUp,true);
......@@ -559,8 +568,8 @@ X3DOMObject.Marker.mouseUp = function(){
}
*/
Scene.element.removeEventListener('mousemove',X3DOMObject.Marker.mouseMove,true);
Scene.element.removeEventListener('mouseup',X3DOMObject.Marker.mouseUp,true);
Scene.element.removeEventListener('mousemove',X3DOMObject.Marker.mouseMove,true);
Scene.draggedTransformNode = null;
Scene.draggingUpVec = null;
......@@ -627,6 +636,8 @@ X3DOMObject.Marker.mouseMove = function(event){
}
if (Scene.draggedTransformNode){
// once we get out of the marker we will get correct world coordinates
console.log(event);
X3DOMObject.Marker.drag(event.offsetX - Scene.lastMouseX, event.offsetY - Scene.lastMouseY);
}
......@@ -858,6 +869,9 @@ X3DOMObject.MapMarker.registerEvents = function(map_mark){
}
/**
* info template
*/
X3DOMObject.displayInfo = function(e){
var elem = Scene.element;
......@@ -910,6 +924,9 @@ X3DOMObject.displayInfo = function(e){
}
/**
* view info template
*/
X3DOMObject.displayViewInfo = function(e){
if (!e.target){
......
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