Skip to content

Commit

Permalink
Merge pull request #587 from openworm/development
Browse files Browse the repository at this point in the history
Rotate around selection got lost in the merge.
  • Loading branch information
tarelli committed Apr 17, 2017
2 parents 71e32e3 + 1247734 commit 87b3df7
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,32 @@ define(function (require) {
if (child.hasOwnProperty("material")) {
GEPPETTO.SceneController.setThreeColor(child.material.color, GEPPETTO.Resources.COLORS.SELECTED);
child.material.opacity = Math.max(0.5, child.material.defaultOpacity);
child.geometry.computeBoundingBox();
GEPPETTO.getVARS().controls.target.copy(child.position);
GEPPETTO.getVARS().controls.target.add(child.geometry.boundingBox.getCenter());
}
});
mesh.selected = true;
mesh.ghosted = false;
} else {
GEPPETTO.SceneController.setThreeColor(mesh.material.color, GEPPETTO.Resources.COLORS.SELECTED);
mesh.material.opacity = Math.max(0.5, mesh.material.defaultOpacity);
mesh.selected = true;
mesh.ghosted = false;
mesh.geometry.computeBoundingBox();
//let's set the center of rotation to the selected mesh
GEPPETTO.getVARS().controls.target.copy(mesh.position);
GEPPETTO.getVARS().controls.target.add(mesh.geometry.boundingBox.getCenter());
}
mesh.selected = true;
mesh.ghosted = false;


GEPPETTO.getVARS().camera.updateProjectionMatrix();

}
if(GEPPETTO.isKeyPressed('z')){
this.zoomTo([eval(instancePath)]);
}

}

return true;
}
return false;
Expand Down

0 comments on commit 87b3df7

Please sign in to comment.