Add Hierarchy display in List and Selection

Add Hierarchy display in List and Selection
This commit is contained in:
Alezia Kurdis 2020-10-21 00:47:55 -04:00 committed by GitHub
parent 8afa978122
commit 48bd101d08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -697,8 +697,10 @@ SelectionDisplay = (function() {
const COLOR_HOVER = { red: 255, green: 220, blue: 82 };
const COLOR_DUPLICATOR = { red: 162, green: 0, blue: 255 };
const COLOR_ROTATE_CURRENT_RING = { red: 255, green: 99, blue: 9 };
const COLOR_BOUNDING_EDGE = { red: 128, green: 128, blue: 128 };
const COLOR_SCALE_CUBE = { red: 160, green: 160, blue: 160 };
const COLOR_BOUNDING_EDGE = { red: 160, green: 160, blue: 160 };
const COLOR_BOUNDING_EDGE_PARENT = { red: 194, green: 123, blue: 0 }; //{ red: 255, green: 160, blue: 0 };
const COLOR_BOUNDING_EDGE_CHILDREN = { red: 0, green: 168, blue: 214 }; // { red: 0, green: 200, blue: 255 }
const COLOR_SCALE_CUBE = { red: 192, green: 192, blue: 192 };
const COLOR_DEBUG_PICK_PLANE = { red: 255, green: 255, blue: 255 };
const COLOR_DEBUG_PICK_PLANE_HIT = { red: 255, green: 165, blue: 0 };
@ -1828,6 +1830,18 @@ SelectionDisplay = (function() {
var rotationZ = Quat.multiply(rotation, localRotationZ);
worldRotationZ = rotationZ;
var handleBoundingBoxColor = COLOR_BOUNDING_EDGE;
if (SelectionManager.selections.length === 1) {
var parentState = getParentState(SelectionManager.selections[0]);
if (parentState === "CHILDREN") {
handleBoundingBoxColor = COLOR_BOUNDING_EDGE_CHILDREN;
} else {
if (parentState === "PARENT" || parentState === "PARENT_CHILDREN") {
handleBoundingBoxColor = COLOR_BOUNDING_EDGE_PARENT;
}
}
}
var selectionBoxGeometry = {
position: position,
rotation: rotation,
@ -1949,6 +1963,7 @@ SelectionDisplay = (function() {
Entities.editEntity(handleBoundingBox, {
position: position,
rotation: rotation,
color: handleBoundingBoxColor,
dimensions: dimensions
});