mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 11:17:50 +02:00
Add delete tool
This commit is contained in:
parent
e2dccc1420
commit
110355796c
3 changed files with 28 additions and 1 deletions
|
@ -18,11 +18,13 @@ ToolIcon = function (side) {
|
||||||
var SCALE_TOOL = 0,
|
var SCALE_TOOL = 0,
|
||||||
CLONE_TOOL = 1,
|
CLONE_TOOL = 1,
|
||||||
GROUP_TOOL = 2,
|
GROUP_TOOL = 2,
|
||||||
|
DELETE_TOOL = 3,
|
||||||
|
|
||||||
ICON_COLORS = [
|
ICON_COLORS = [
|
||||||
{ red: 0, green: 240, blue: 240 },
|
{ red: 0, green: 240, blue: 240 },
|
||||||
{ red: 240, green: 240, blue: 0 },
|
{ red: 240, green: 240, blue: 0 },
|
||||||
{ red: 220, green: 60, blue: 220 }
|
{ red: 220, green: 60, blue: 220 },
|
||||||
|
{ red: 240, green: 60, blue: 60 }
|
||||||
],
|
],
|
||||||
|
|
||||||
LEFT_HAND = 0,
|
LEFT_HAND = 0,
|
||||||
|
@ -103,6 +105,7 @@ ToolIcon = function (side) {
|
||||||
SCALE_TOOL: SCALE_TOOL,
|
SCALE_TOOL: SCALE_TOOL,
|
||||||
CLONE_TOOL: CLONE_TOOL,
|
CLONE_TOOL: CLONE_TOOL,
|
||||||
GROUP_TOOL: GROUP_TOOL,
|
GROUP_TOOL: GROUP_TOOL,
|
||||||
|
DELETE_TOOL: DELETE_TOOL,
|
||||||
setHand: setHand,
|
setHand: setHand,
|
||||||
update: update,
|
update: update,
|
||||||
display: display,
|
display: display,
|
||||||
|
|
|
@ -158,6 +158,15 @@ ToolMenu = function (side, leftInputs, rightInputs, commandCallback) {
|
||||||
},
|
},
|
||||||
toolOptions: "groupOptions",
|
toolOptions: "groupOptions",
|
||||||
callback: "groupTool"
|
callback: "groupTool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "deleteButton",
|
||||||
|
type: "button",
|
||||||
|
properties: {
|
||||||
|
localPosition: { x: 0.022, y: 0.04, z: -0.005 },
|
||||||
|
color: { red: 240, green: 60, blue: 60 }
|
||||||
|
},
|
||||||
|
callback: "deleteTool"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
TOOL_SCALE = 1,
|
TOOL_SCALE = 1,
|
||||||
TOOL_CLONE = 2,
|
TOOL_CLONE = 2,
|
||||||
TOOL_GROUP = 3,
|
TOOL_GROUP = 3,
|
||||||
|
TOOL_DELETE = 4,
|
||||||
toolSelected = TOOL_NONE,
|
toolSelected = TOOL_NONE,
|
||||||
|
|
||||||
// Primary objects
|
// Primary objects
|
||||||
|
@ -268,6 +269,7 @@
|
||||||
SCALE_TOOL: toolIcon.SCALE_TOOL,
|
SCALE_TOOL: toolIcon.SCALE_TOOL,
|
||||||
CLONE_TOOL: toolIcon.CLONE_TOOL,
|
CLONE_TOOL: toolIcon.CLONE_TOOL,
|
||||||
GROUP_TOOL: toolIcon.GROUP_TOOL,
|
GROUP_TOOL: toolIcon.GROUP_TOOL,
|
||||||
|
DELETE_TOOL: toolIcon.DELETE_TOOL,
|
||||||
display: display,
|
display: display,
|
||||||
updateUIEntities: setUIEntities,
|
updateUIEntities: setUIEntities,
|
||||||
update: update,
|
update: update,
|
||||||
|
@ -844,6 +846,10 @@
|
||||||
setState(EDITOR_CLONING);
|
setState(EDITOR_CLONING);
|
||||||
} else if (toolSelected === TOOL_GROUP) {
|
} else if (toolSelected === TOOL_GROUP) {
|
||||||
setState(EDITOR_GROUPING);
|
setState(EDITOR_GROUPING);
|
||||||
|
} else if (toolSelected === TOOL_DELETE) {
|
||||||
|
setState(EDITOR_HIGHLIGHTING);
|
||||||
|
selection.deleteEntities();
|
||||||
|
setState(EDITOR_SEARCHING);
|
||||||
} else {
|
} else {
|
||||||
setState(EDITOR_GRABBING);
|
setState(EDITOR_GRABBING);
|
||||||
}
|
}
|
||||||
|
@ -895,6 +901,9 @@
|
||||||
setState(EDITOR_CLONING);
|
setState(EDITOR_CLONING);
|
||||||
} else if (toolSelected === TOOL_GROUP) {
|
} else if (toolSelected === TOOL_GROUP) {
|
||||||
setState(EDITOR_GROUPING);
|
setState(EDITOR_GROUPING);
|
||||||
|
} else if (toolSelected === TOOL_DELETE) {
|
||||||
|
selection.deleteEntities();
|
||||||
|
setState(EDITOR_SEARCHING);
|
||||||
} else {
|
} else {
|
||||||
setState(EDITOR_GRABBING);
|
setState(EDITOR_GRABBING);
|
||||||
}
|
}
|
||||||
|
@ -1237,6 +1246,12 @@
|
||||||
ui.setToolIcon(ui.GROUP_TOOL);
|
ui.setToolIcon(ui.GROUP_TOOL);
|
||||||
ui.updateUIEntities();
|
ui.updateUIEntities();
|
||||||
break;
|
break;
|
||||||
|
case "deleteTool":
|
||||||
|
grouping.clear();
|
||||||
|
toolSelected = TOOL_DELETE;
|
||||||
|
ui.setToolIcon(ui.DELETE_TOOL);
|
||||||
|
ui.updateUIEntities();
|
||||||
|
break;
|
||||||
case "groupButton":
|
case "groupButton":
|
||||||
grouping.group();
|
grouping.group();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue