mirror of
https://github.com/overte-org/overte.git
synced 2025-07-17 10:16:51 +02:00
Merge pull request #10128 from kunalgosar/fingerpainting
Make it easier to exit FingerPaint
This commit is contained in:
commit
45bb639ef5
2 changed files with 27 additions and 1 deletions
|
@ -23,6 +23,7 @@
|
||||||
HIFI_POINT_INDEX_MESSAGE_CHANNEL = "Hifi-Point-Index",
|
HIFI_POINT_INDEX_MESSAGE_CHANNEL = "Hifi-Point-Index",
|
||||||
HIFI_GRAB_DISABLE_MESSAGE_CHANNEL = "Hifi-Grab-Disable",
|
HIFI_GRAB_DISABLE_MESSAGE_CHANNEL = "Hifi-Grab-Disable",
|
||||||
HIFI_POINTER_DISABLE_MESSAGE_CHANNEL = "Hifi-Pointer-Disable";
|
HIFI_POINTER_DISABLE_MESSAGE_CHANNEL = "Hifi-Pointer-Disable";
|
||||||
|
HOW_TO_EXIT_MESSAGE = "Press B on your controller to exit FingerPainting mode";
|
||||||
|
|
||||||
function paintBrush(name) {
|
function paintBrush(name) {
|
||||||
// Paints in 3D.
|
// Paints in 3D.
|
||||||
|
@ -319,6 +320,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function howToExitTutorial() {
|
||||||
|
HMD.requestShowHandControllers();
|
||||||
|
setControllerPartLayer('button_b', 'highlight');
|
||||||
|
messageWindow = Window.alert(HOW_TO_EXIT_MESSAGE);
|
||||||
|
setControllerPartLayer('button_b', 'blank');
|
||||||
|
HMD.requestHideHandControllers();
|
||||||
|
Settings.setValue("FingerPaintTutorialComplete", true);
|
||||||
|
}
|
||||||
|
|
||||||
function enableProcessing() {
|
function enableProcessing() {
|
||||||
// Connect controller API to handController objects.
|
// Connect controller API to handController objects.
|
||||||
leftHand = handController("left");
|
leftHand = handController("left");
|
||||||
|
@ -328,7 +338,12 @@
|
||||||
controllerMapping.from(Controller.Standard.LeftGrip).to(leftHand.onGripPress);
|
controllerMapping.from(Controller.Standard.LeftGrip).to(leftHand.onGripPress);
|
||||||
controllerMapping.from(Controller.Standard.RT).to(rightHand.onTriggerPress);
|
controllerMapping.from(Controller.Standard.RT).to(rightHand.onTriggerPress);
|
||||||
controllerMapping.from(Controller.Standard.RightGrip).to(rightHand.onGripPress);
|
controllerMapping.from(Controller.Standard.RightGrip).to(rightHand.onGripPress);
|
||||||
|
controllerMapping.from(Controller.Standard.B).to(onButtonClicked);
|
||||||
Controller.enableMapping(CONTROLLER_MAPPING_NAME);
|
Controller.enableMapping(CONTROLLER_MAPPING_NAME);
|
||||||
|
|
||||||
|
if (!Settings.getValue("FingerPaintTutorialComplete")) {
|
||||||
|
howToExitTutorial();
|
||||||
|
}
|
||||||
|
|
||||||
// Connect handController outputs to paintBrush objects.
|
// Connect handController outputs to paintBrush objects.
|
||||||
leftBrush = paintBrush("left");
|
leftBrush = paintBrush("left");
|
||||||
|
@ -433,6 +448,17 @@
|
||||||
button.clicked.disconnect(onButtonClicked);
|
button.clicked.disconnect(onButtonClicked);
|
||||||
tablet.removeButton(button);
|
tablet.removeButton(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A controller is made up of parts, and each part can have multiple "layers,"
|
||||||
|
* which are really just different texures. For example, the "trigger" part
|
||||||
|
* has "normal" and "highlight" layers.
|
||||||
|
*/
|
||||||
|
function setControllerPartLayer(part, layer) {
|
||||||
|
data = {};
|
||||||
|
data[part] = layer;
|
||||||
|
Messages.sendLocalMessage('Controller-Set-Part-Layer', JSON.stringify(data));
|
||||||
|
}
|
||||||
|
|
||||||
setUp();
|
setUp();
|
||||||
Script.scriptEnding.connect(tearDown);
|
Script.scriptEnding.connect(tearDown);
|
||||||
|
|
|
@ -118,7 +118,7 @@ function findEntitiesWithTag(tag) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A controller in made up of parts, and each part can have multiple "layers,"
|
* A controller is made up of parts, and each part can have multiple "layers,"
|
||||||
* which are really just different texures. For example, the "trigger" part
|
* which are really just different texures. For example, the "trigger" part
|
||||||
* has "normal" and "highlight" layers.
|
* has "normal" and "highlight" layers.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue