Merge pull request #13656 from huffman/fix/create-selection-box

Fix the Create selection box not always matching outline
This commit is contained in:
Thijs Wenker 2018-07-24 19:49:20 +02:00 committed by GitHub
commit b7d12c6b1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -263,7 +263,7 @@ SelectionManager = (function() {
that.worldDimensions = properties.boundingBox.dimensions;
that.worldPosition = properties.boundingBox.center;
that.worldRotation = properties.boundingBox.rotation;
that.worldRotation = Quat.IDENTITY;
that.entityType = properties.type;
@ -271,10 +271,6 @@ SelectionManager = (function() {
SelectionDisplay.setSpaceMode(SPACE_LOCAL);
}
} else {
that.localRotation = null;
that.localDimensions = null;
that.localPosition = null;
properties = Entities.getEntityProperties(that.selections[0]);
that.entityType = properties.type;
@ -293,6 +289,7 @@ SelectionManager = (function() {
tfl.z = Math.max(bb.tfl.z, tfl.z);
}
that.localRotation = null;
that.localDimensions = null;
that.localPosition = null;
that.worldDimensions = {
@ -300,6 +297,7 @@ SelectionManager = (function() {
y: tfl.y - brn.y,
z: tfl.z - brn.z
};
that.worldRotation = Quat.IDENTITY;
that.worldPosition = {
x: brn.x + (that.worldDimensions.x / 2),
y: brn.y + (that.worldDimensions.y / 2),