mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 12:18:36 +02:00
Add grouping state
This commit is contained in:
parent
6d90b6d0fd
commit
7e1584a43e
1 changed files with 36 additions and 1 deletions
|
@ -293,8 +293,9 @@
|
||||||
EDITOR_DIRECT_SCALING = 4, // Scaling data are sent to other editor's EDITOR_GRABBING state.
|
EDITOR_DIRECT_SCALING = 4, // Scaling data are sent to other editor's EDITOR_GRABBING state.
|
||||||
EDITOR_HANDLE_SCALING = 5, // ""
|
EDITOR_HANDLE_SCALING = 5, // ""
|
||||||
EDITOR_CLONING = 6,
|
EDITOR_CLONING = 6,
|
||||||
|
EDITOR_GROUPING = 7,
|
||||||
EDITOR_STATE_STRINGS = ["EDITOR_IDLE", "EDITOR_SEARCHING", "EDITOR_HIGHLIGHTING", "EDITOR_GRABBING",
|
EDITOR_STATE_STRINGS = ["EDITOR_IDLE", "EDITOR_SEARCHING", "EDITOR_HIGHLIGHTING", "EDITOR_GRABBING",
|
||||||
"EDITOR_DIRECT_SCALING", "EDITOR_HANDLE_SCALING", "EDITOR_CLONING"],
|
"EDITOR_DIRECT_SCALING", "EDITOR_HANDLE_SCALING", "EDITOR_CLONING", "EDITOR_GROUPING"],
|
||||||
editorState = EDITOR_IDLE,
|
editorState = EDITOR_IDLE,
|
||||||
|
|
||||||
// State machine.
|
// State machine.
|
||||||
|
@ -711,6 +712,14 @@
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function enterEditorGrouping() {
|
||||||
|
// TODO: Add/remove highlightedEntityID to/from groups.
|
||||||
|
}
|
||||||
|
|
||||||
|
function exitEditorGrouping() {
|
||||||
|
// Nothing to do.
|
||||||
|
}
|
||||||
|
|
||||||
STATE_MACHINE = {
|
STATE_MACHINE = {
|
||||||
EDITOR_IDLE: {
|
EDITOR_IDLE: {
|
||||||
enter: enterEditorIdle,
|
enter: enterEditorIdle,
|
||||||
|
@ -746,6 +755,11 @@
|
||||||
enter: enterEditorCloning,
|
enter: enterEditorCloning,
|
||||||
update: null,
|
update: null,
|
||||||
exit: exitEditorCloning
|
exit: exitEditorCloning
|
||||||
|
},
|
||||||
|
EDITOR_GROUPING: {
|
||||||
|
enter: enterEditorGrouping,
|
||||||
|
update: null,
|
||||||
|
exit: exitEditorGrouping
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -814,6 +828,8 @@
|
||||||
}
|
}
|
||||||
} else if (toolSelected === TOOL_CLONE) {
|
} else if (toolSelected === TOOL_CLONE) {
|
||||||
setState(EDITOR_CLONING);
|
setState(EDITOR_CLONING);
|
||||||
|
} else if (toolSelected === TOOL_GROUP) {
|
||||||
|
setState(EDITOR_GROUPING);
|
||||||
} else {
|
} else {
|
||||||
setState(EDITOR_GRABBING);
|
setState(EDITOR_GRABBING);
|
||||||
}
|
}
|
||||||
|
@ -861,6 +877,8 @@
|
||||||
}
|
}
|
||||||
} else if (toolSelected === TOOL_CLONE) {
|
} else if (toolSelected === TOOL_CLONE) {
|
||||||
setState(EDITOR_CLONING);
|
setState(EDITOR_CLONING);
|
||||||
|
} else if (toolSelected === TOOL_GROUP) {
|
||||||
|
setState(EDITOR_GROUPING);
|
||||||
} else {
|
} else {
|
||||||
setState(EDITOR_GRABBING);
|
setState(EDITOR_GRABBING);
|
||||||
}
|
}
|
||||||
|
@ -922,6 +940,8 @@
|
||||||
} else if (!otherEditor.isEditing(highlightedEntityID)) {
|
} else if (!otherEditor.isEditing(highlightedEntityID)) {
|
||||||
// Grab highlightEntityID that was scaling and has already been set.
|
// Grab highlightEntityID that was scaling and has already been set.
|
||||||
setState(EDITOR_GRABBING);
|
setState(EDITOR_GRABBING);
|
||||||
|
} else {
|
||||||
|
debug(side, "ERROR: Unexpected condition in EDITOR_DIRECT_SCALING!");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EDITOR_HANDLE_SCALING:
|
case EDITOR_HANDLE_SCALING:
|
||||||
|
@ -946,6 +966,8 @@
|
||||||
} else if (!otherEditor.isEditing(highlightedEntityID)) {
|
} else if (!otherEditor.isEditing(highlightedEntityID)) {
|
||||||
// Grab highlightEntityID that was scaling and has already been set.
|
// Grab highlightEntityID that was scaling and has already been set.
|
||||||
setState(EDITOR_GRABBING);
|
setState(EDITOR_GRABBING);
|
||||||
|
} else {
|
||||||
|
debug(side, "ERROR: Unexpected condition in EDITOR_HANDLE_SCALING!");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EDITOR_CLONING:
|
case EDITOR_CLONING:
|
||||||
|
@ -961,6 +983,19 @@
|
||||||
} else {
|
} else {
|
||||||
setState(EDITOR_SEARCHING);
|
setState(EDITOR_SEARCHING);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
debug(side, "ERROR: Unexpected condition in EDITOR_CLONING!");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EDITOR_GROUPING:
|
||||||
|
if (hand.valid() && isTriggerClicked) {
|
||||||
|
// No transition.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!hand.valid()) {
|
||||||
|
setState(EDITOR_IDLE);
|
||||||
|
} else {
|
||||||
|
setState(EDITOR_SEARCHING);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue