mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 15:14:19 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into metavoxels
This commit is contained in:
commit
9c0e3ead13
3 changed files with 1277 additions and 1538 deletions
|
@ -97,11 +97,12 @@ EntityCameraTool = function() {
|
|||
|
||||
that.focus = function(entityProperties) {
|
||||
var dim = entityProperties.dimensions;
|
||||
dim = SelectionManager.worldDimensions;
|
||||
var size = Math.max(dim.x, Math.max(dim.y, dim.z));
|
||||
|
||||
that.targetZoomDistance = Math.max(size * FOCUS_ZOOM_SCALE, FOCUS_MIN_ZOOM);
|
||||
|
||||
that.setFocalPoint(entityProperties.position);
|
||||
that.setFocalPoint(SelectionManager.worldPosition);//entityProperties.position);
|
||||
|
||||
that.updateCamera();
|
||||
}
|
||||
|
@ -184,7 +185,7 @@ EntityCameraTool = function() {
|
|||
// Scale based on current zoom level
|
||||
dZoom *= that.targetZoomDistance * ZOOM_SCALING;
|
||||
|
||||
that.targetZoomDistance = Math.max(Math.min(that.targetZoomDistance + dZoom, MAX_ZOOM_DISTANCE), MIN_ZOOM_DISTANCE);
|
||||
that.targetZoomDistance = Math.max(that.targetZoomDistance + dZoom, MIN_ZOOM_DISTANCE);
|
||||
|
||||
that.updateCamera();
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -21,6 +21,7 @@ Script.include("libraries/progressDialog.js");
|
|||
|
||||
Script.include("libraries/entitySelectionTool.js");
|
||||
var selectionDisplay = SelectionDisplay;
|
||||
var selectionManager = SelectionManager;
|
||||
|
||||
Script.include("libraries/ModelImporter.js");
|
||||
var modelImporter = new ModelImporter();
|
||||
|
@ -34,6 +35,8 @@ var entityPropertyDialogBox = EntityPropertyDialogBox;
|
|||
Script.include("libraries/entityCameraTool.js");
|
||||
var entityCameraTool = new EntityCameraTool();
|
||||
|
||||
selectionManager.setEventListener(selectionDisplay.updateHandles());
|
||||
|
||||
var windowDimensions = Controller.getViewportDimensions();
|
||||
var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/";
|
||||
var toolHeight = 50;
|
||||
|
@ -440,6 +443,11 @@ function mousePressEvent(event) {
|
|||
orientation = MyAvatar.orientation;
|
||||
intersection = rayPlaneIntersection(pickRay, P, Quat.getFront(orientation));
|
||||
|
||||
if (!event.isShifted) {
|
||||
selectionManager.clearSelections();
|
||||
}
|
||||
selectionManager.addEntity(foundEntity);
|
||||
|
||||
print("Model selected selectedEntityID:" + selectedEntityID.id);
|
||||
|
||||
}
|
||||
|
@ -641,14 +649,21 @@ Menu.menuItemEvent.connect(handeMenuEvent);
|
|||
|
||||
Controller.keyReleaseEvent.connect(function (event) {
|
||||
// since sometimes our menu shortcut keys don't work, trap our menu items here also and fire the appropriate menu items
|
||||
print(event.text);
|
||||
if (event.text == "`") {
|
||||
handeMenuEvent("Edit Properties...");
|
||||
}
|
||||
if (event.text == "BACKSPACE") {
|
||||
handeMenuEvent("Delete");
|
||||
} else if (event.text == "TAB") {
|
||||
selectionDisplay.toggleSpaceMode();
|
||||
} else if (event.text == "ESC") {
|
||||
selectionDisplay.cancelTool();
|
||||
} else if (event.text == "f") {
|
||||
if (entitySelected) {
|
||||
entityCameraTool.focus(selectedEntityProperties);
|
||||
// Get latest properties
|
||||
var properties = Entities.getEntityProperties(selectedEntityID);
|
||||
entityCameraTool.focus(properties);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue