Commit 65ac9d4f authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

improved marker removing

parent 3d5b9027
...@@ -428,6 +428,8 @@ function x3d_events(){ ...@@ -428,6 +428,8 @@ function x3d_events(){
if (e.key=="Control"){ if (e.key=="Control"){
Scene._ctrlKey = true;
var x,y,z; var x,y,z;
var dist = 1111; var dist = 1111;
...@@ -438,7 +440,7 @@ function x3d_events(){ ...@@ -438,7 +440,7 @@ function x3d_events(){
dist = parseFloat(mouse.d_xz); dist = parseFloat(mouse.d_xz);
X3DOMObject.Marker.place(mouse.x,mouse.y,mouse.z,"sliding_sphere"); X3DOMObject.Marker.place(mouse.x,mouse.y,mouse.z,"sliding_sphere");
$("#sliding_sphere").find("switch").attr("whichChoice",0); if (Scene.highlighted_marker_index==null) $("#sliding_sphere").find("switch").attr("whichChoice",0);
} }
...@@ -458,6 +460,9 @@ function x3d_events(){ ...@@ -458,6 +460,9 @@ function x3d_events(){
if (e.key=="Control"){ if (e.key=="Control"){
Scene._ctrlKey = false;
//remove on keydown?
X3DOMObject.Marker.place(0,0,0,"sliding_sphere"); X3DOMObject.Marker.place(0,0,0,"sliding_sphere");
$("#sliding_sphere").find("switch").attr("whichChoice",-1); $("#sliding_sphere").find("switch").attr("whichChoice",-1);
......
...@@ -304,13 +304,14 @@ X3DOMObject.Shape.prototype._registerEvents = function(){ ...@@ -304,13 +304,14 @@ X3DOMObject.Shape.prototype._registerEvents = function(){
var y = e.originalEvent.worldY; var y = e.originalEvent.worldY;
var z = e.originalEvent.worldZ; var z = e.originalEvent.worldZ;
// store x3dom event to use in normal events // (not used atm) store x3dom event to use in normal events
self._stored_x3dom_event = e.originalEvent; self._stored_x3dom_event = e.originalEvent;
if (self._ctrlKey||SETTINGS.pointer){ if (self._ctrlKey||SETTINGS.pointer){
// place pointer marker // place pointer marker
$("#sliding_sphere").find('material').attr("diffuseColor",convert_color_l2x(SETTINGS.markercolor)); $("#sliding_sphere").find('material').attr("diffuseColor",convert_color_l2x(SETTINGS.markercolor));
$("#sliding_sphere").find('material').attr("transparency","0.2");
$("#sliding_sphere").find('Sphere').attr("radius",SETTINGS.markersize/2); $("#sliding_sphere").find('Sphere').attr("radius",SETTINGS.markersize/2);
X3DOMObject.Marker.place(x,y,z,"sliding_sphere"); X3DOMObject.Marker.place(x,y,z,"sliding_sphere");
...@@ -664,6 +665,7 @@ X3DOMObject.Marker.prototype._registerEvents = function(){ ...@@ -664,6 +665,7 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
Map.deleteMarker(index); Map.deleteMarker(index);
Scene.highlighted_marker_index = null;
} }
}else{ }else{
......
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