use axis aligned bounding box for highlight and selection box instead of non-axis aligned box

This commit is contained in:
ZappoMan 2014-10-10 17:11:27 -07:00
parent 82a9429414
commit cdafba603d

View file

@ -393,14 +393,8 @@ SelectionDisplay = (function () {
that.highlightSelectable = function(entityID) { that.highlightSelectable = function(entityID) {
var properties = Entities.getEntityProperties(entityID); var properties = Entities.getEntityProperties(entityID);
var center = { x: properties.position.x, y: properties.position.y, z: properties.position.z }; Overlays.editOverlay(highlightBox, { visible: true, position: properties.boundingBox.center,
Overlays.editOverlay(highlightBox, dimensions: properties.boundingBox.dimensions });
{
visible: true,
position: center,
dimensions: properties.dimensions,
rotation: properties.rotation,
});
}; };
that.unhighlightSelectable = function(entityID) { that.unhighlightSelectable = function(entityID) {
@ -642,8 +636,8 @@ SelectionDisplay = (function () {
Overlays.editOverlay(highlightBox, { visible: false }); Overlays.editOverlay(highlightBox, { visible: false });
Overlays.editOverlay(selectionBox, { visible: selectionBoxVisible, position: objectCenter, dimensions: properties.dimensions, Overlays.editOverlay(selectionBox, { visible: selectionBoxVisible, position: properties.boundingBox.center,
rotation: properties.rotation,}); dimensions: properties.boundingBox.dimensions });
Overlays.editOverlay(grabberMoveUp, { visible: translateHandlesVisible, position: { x: boundsCenter.x, y: top + grabberMoveUpOffset, z: boundsCenter.z } }); Overlays.editOverlay(grabberMoveUp, { visible: translateHandlesVisible, position: { x: boundsCenter.x, y: top + grabberMoveUpOffset, z: boundsCenter.z } });