Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
Add click out to disable object selection (+ fixes on hud)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbiobob committed Apr 18, 2016
1 parent 8816395 commit 35922e4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
9 changes: 7 additions & 2 deletions js/components/action.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ var Action = {
if(intersection.object.clickable) {

var indexPoint = intersection.index;
var selPoint = intersection.object.geometry.vertices[indexPoint];

Action.hoverOnObj(indexPoint);
return;
if(selPoint.visible) {
Action.hoverOnObj(indexPoint);
return;
}
}
}

Expand Down Expand Up @@ -227,6 +230,8 @@ var Action = {

}

obj.disableSelection();

},

/**
Expand Down
11 changes: 6 additions & 5 deletions js/components/galaxy.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,43 +74,44 @@ var Galaxy = {
if(!Ed3d.showGalaxyInfos) return;

this.infos = new THREE.Object3D();
var obj = this;

$.getJSON(Ed3d.basePath + "data/milkyway.json", function(data) {

$.each(data.quadrants, function(key, val) {

this.addText(key,val.x,-100,val.z,val.rotate);
obj.addText(key,val.x,-100,val.z,val.rotate);

});

$.each(data.arms, function(key, val) {

$.each(val, function(keyCh, valCh) {
this.addText(key,valCh.x,0,valCh.z,valCh.rotate,300,true);
obj.addText(key,valCh.x,0,valCh.z,valCh.rotate,300,true);
});

});

$.each(data.gaps, function(key, val) {

$.each(val, function(keyCh, valCh) {
this.addText(key,valCh.x,0,valCh.z,valCh.rotate,160,true);
obj.addText(key,valCh.x,0,valCh.z,valCh.rotate,160,true);
});

});

$.each(data.others, function(key, val) {

$.each(val, function(keyCh, valCh) {
this.addText(key,valCh.x,0,valCh.z,valCh.rotate,160,true);
obj.addText(key,valCh.x,0,valCh.z,valCh.rotate,160,true);
});

});


}).done(function() {

scene.add(this.infos);
scene.add(obj.infos);

});

Expand Down
4 changes: 3 additions & 1 deletion js/components/hud.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var HUD = {
'create' : function(container) {

this.container = container;

if(!$('#'+this.container+' #controls').length && Ed3d.withOptionsPanel == true) {

$('#'+this.container).append(
Expand Down Expand Up @@ -252,6 +252,8 @@ var HUD = {

});

if(nbPoint==0) return;

//-- Calc center of all selected points
center.set(
Math.round(center.x/nbPoint),
Expand Down
2 changes: 1 addition & 1 deletion js/ed3dmap.min.js

Large diffs are not rendered by default.

0 comments on commit 35922e4

Please sign in to comment.