mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
added tutorial
This commit is contained in:
parent
d66038fff2
commit
b8500e45ad
1 changed files with 25 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
HIFI_POINT_INDEX_MESSAGE_CHANNEL = "Hifi-Point-Index",
|
||||
HIFI_GRAB_DISABLE_MESSAGE_CHANNEL = "Hifi-Grab-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) {
|
||||
// Paints in 3D.
|
||||
|
@ -319,6 +320,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
function howToExitTutorial() {
|
||||
HMD.requestShowHandControllers();
|
||||
setControllerPartLayer('button_b', 'highlight');
|
||||
Window.alert(HOW_TO_EXIT_MESSAGE);
|
||||
setControllerPartLayer('button_b', 'blank');
|
||||
HMD.requestHideHandControllers();
|
||||
Settings.setValue("FingerPaintTutorialComplete", true);
|
||||
}
|
||||
|
||||
function enableProcessing() {
|
||||
// Connect controller API to handController objects.
|
||||
leftHand = handController("left");
|
||||
|
@ -330,6 +340,10 @@
|
|||
controllerMapping.from(Controller.Standard.RightGrip).to(rightHand.onGripPress);
|
||||
controllerMapping.from(Controller.Standard.B).to(onButtonClicked);
|
||||
Controller.enableMapping(CONTROLLER_MAPPING_NAME);
|
||||
|
||||
if (!Settings.getValue("FingerPaintTutorialComplete")) {
|
||||
howToExitTutorial();
|
||||
}
|
||||
|
||||
// Connect handController outputs to paintBrush objects.
|
||||
leftBrush = paintBrush("left");
|
||||
|
@ -434,6 +448,17 @@
|
|||
button.clicked.disconnect(onButtonClicked);
|
||||
tablet.removeButton(button);
|
||||
}
|
||||
|
||||
/**
|
||||
* A controller in 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();
|
||||
Script.scriptEnding.connect(tearDown);
|
||||
|
|
Loading…
Reference in a new issue