From 55b92f7d1e75668412d688c4c50b651daaefcf03 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Apr 2015 15:18:31 -0700 Subject: [PATCH 01/12] Circle of origin for rain --- examples/example/entities/rain.js | 69 +++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 examples/example/entities/rain.js diff --git a/examples/example/entities/rain.js b/examples/example/entities/rain.js new file mode 100644 index 0000000000..4cc8827293 --- /dev/null +++ b/examples/example/entities/rain.js @@ -0,0 +1,69 @@ +// +// rain.js +// examples +// +// Created by David Rowe on 9 Apr 2015. +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +var RainSquall = function (properties) { + var // Properties + origin, + radius, + debug = false, // Display origin circle + // Other + squallCircle, + SQUALL_CIRCLE_COLOR = { red: 255, green: 0, blue: 0 }, + SQUALL_CIRCLE_ALPHA = 0.3, + SQUALL_CIRCLE_ROTATION = Quat.fromPitchYawRollDegrees(90, 0, 0); + + function processProperties() { + if (!properties.hasOwnProperty("origin")) { + print("ERROR: Rain squall origin must be specified"); + return; + } + origin = properties.origin; + + if (!properties.hasOwnProperty("radius")) { + print("ERROR: Rain squall radius must be specified"); + return; + } + radius = properties.radius; + + if (properties.hasOwnProperty("debug")) { + debug = properties.debug; + } + } + + function setUp() { + squallCircle = Overlays.addOverlay("circle3d", { + size: { x: radius, y: radius }, + color: SQUALL_CIRCLE_COLOR, + alpha: SQUALL_CIRCLE_ALPHA, + solid: true, + visible: debug, + position: origin, + rotation: SQUALL_CIRCLE_ROTATION + }); + } + + function tearDown() { + Overlays.deleteOverlay(squallCircle); + } + + processProperties(); + setUp(); + Script.scriptEnding.connect(tearDown); + + return { + }; +}; + +var rainSquall1 = new RainSquall({ + origin: { x: 8192, y: 8200, z: 8192 }, + radius: 2.5, + debug: true +}); \ No newline at end of file From e4e372b2a38fbc205157131d03144270800ed3bd Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Apr 2015 15:51:19 -0700 Subject: [PATCH 02/12] Create a raindrop with a lifetime --- examples/example/entities/rain.js | 34 +++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/examples/example/entities/rain.js b/examples/example/entities/rain.js index 4cc8827293..a4860a1eac 100644 --- a/examples/example/entities/rain.js +++ b/examples/example/entities/rain.js @@ -13,12 +13,17 @@ var RainSquall = function (properties) { var // Properties origin, radius, + dropSize = { x: 0.1, y: 0.1, z: 0.1 }, + dropLifetime = 60, // Seconds debug = false, // Display origin circle // Other squallCircle, SQUALL_CIRCLE_COLOR = { red: 255, green: 0, blue: 0 }, - SQUALL_CIRCLE_ALPHA = 0.3, - SQUALL_CIRCLE_ROTATION = Quat.fromPitchYawRollDegrees(90, 0, 0); + SQUALL_CIRCLE_ALPHA = 0.5, + SQUALL_CIRCLE_ROTATION = Quat.fromPitchYawRollDegrees(90, 0, 0), + raindropProperties, + RAINDROP_MODEL_URL = "https://s3.amazonaws.com/hifi-public/ozan/Polyworld/Sets/sky/tetrahedron_v1-Faceted2.fbx", + raindropTimer; function processProperties() { if (!properties.hasOwnProperty("origin")) { @@ -33,9 +38,29 @@ var RainSquall = function (properties) { } radius = properties.radius; + if (properties.hasOwnProperty("dropSize")) { + dropSize = properties.dropSize; + } + + if (properties.hasOwnProperty("dropLifetime")) { + dropLifetime = properties.dropLifetime; + } + if (properties.hasOwnProperty("debug")) { debug = properties.debug; } + + raindropProperties = { + type: "Model", + modelURL: RAINDROP_MODEL_URL, + lifetime: dropLifetime, + dimensions: dropSize + }; + } + + function createRaindrop() { + raindropProperties.position = Vec3.sum(origin, { x: 0, y: -0.1, z: 0 }); + Entities.addEntity(raindropProperties); } function setUp() { @@ -48,9 +73,12 @@ var RainSquall = function (properties) { position: origin, rotation: SQUALL_CIRCLE_ROTATION }); + + raindropTimer = Script.setInterval(createRaindrop, 3000); } function tearDown() { + Script.clearInterval(raindropTimer); Overlays.deleteOverlay(squallCircle); } @@ -65,5 +93,7 @@ var RainSquall = function (properties) { var rainSquall1 = new RainSquall({ origin: { x: 8192, y: 8200, z: 8192 }, radius: 2.5, + dropSize: { x: 0.1, y: 0.1, z: 0.1 }, + dropLifetime: 2, debug: true }); \ No newline at end of file From 00f42c1e6cfd6211060570ab58c09121e6ba5a21 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Apr 2015 15:52:59 -0700 Subject: [PATCH 03/12] Move to acScripts --- examples/{example/entities => acScripts}/rain.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{example/entities => acScripts}/rain.js (100%) diff --git a/examples/example/entities/rain.js b/examples/acScripts/rain.js similarity index 100% rename from examples/example/entities/rain.js rename to examples/acScripts/rain.js From 66ea84977a75cb9300bd971cb4613fd7859690c0 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Apr 2015 16:18:10 -0700 Subject: [PATCH 04/12] Create raindrops at specified rate --- examples/acScripts/rain.js | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/examples/acScripts/rain.js b/examples/acScripts/rain.js index a4860a1eac..b2aa4427de 100644 --- a/examples/acScripts/rain.js +++ b/examples/acScripts/rain.js @@ -11,10 +11,11 @@ var RainSquall = function (properties) { var // Properties - origin, - radius, + squallOrigin, + squallRadius, dropSize = { x: 0.1, y: 0.1, z: 0.1 }, dropLifetime = 60, // Seconds + dropsPerMinute = 60, debug = false, // Display origin circle // Other squallCircle, @@ -30,13 +31,13 @@ var RainSquall = function (properties) { print("ERROR: Rain squall origin must be specified"); return; } - origin = properties.origin; + squallOrigin = properties.origin; if (!properties.hasOwnProperty("radius")) { print("ERROR: Rain squall radius must be specified"); return; } - radius = properties.radius; + squallRadius = properties.radius; if (properties.hasOwnProperty("dropSize")) { dropSize = properties.dropSize; @@ -46,6 +47,10 @@ var RainSquall = function (properties) { dropLifetime = properties.dropLifetime; } + if (properties.hasOwnProperty("dropsPerMinute")) { + dropsPerMinute = properties.dropsPerMinute; + } + if (properties.hasOwnProperty("debug")) { debug = properties.debug; } @@ -59,22 +64,28 @@ var RainSquall = function (properties) { } function createRaindrop() { - raindropProperties.position = Vec3.sum(origin, { x: 0, y: -0.1, z: 0 }); + var angle, + radius, + offset; + angle = Math.random() * 360; + radius = Math.random() * squallRadius; + offset = Vec3.multiplyQbyV(Quat.fromPitchYawRollDegrees(0, angle, 0), { x: 0, y: -0.1, z: radius }); + raindropProperties.position = Vec3.sum(squallOrigin, offset); Entities.addEntity(raindropProperties); } function setUp() { squallCircle = Overlays.addOverlay("circle3d", { - size: { x: radius, y: radius }, + size: { x: 2 * squallRadius, y: 2 * squallRadius }, color: SQUALL_CIRCLE_COLOR, alpha: SQUALL_CIRCLE_ALPHA, solid: true, visible: debug, - position: origin, + position: squallOrigin, rotation: SQUALL_CIRCLE_ROTATION }); - raindropTimer = Script.setInterval(createRaindrop, 3000); + raindropTimer = Script.setInterval(createRaindrop, 60000 / dropsPerMinute); } function tearDown() { @@ -94,6 +105,7 @@ var rainSquall1 = new RainSquall({ origin: { x: 8192, y: 8200, z: 8192 }, radius: 2.5, dropSize: { x: 0.1, y: 0.1, z: 0.1 }, - dropLifetime: 2, + dropLifetime: 10, + dropsPerMinute: 120, debug: true }); \ No newline at end of file From 54980f46a91e132d66b7fd958e6042d2618eb235 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Apr 2015 17:29:14 -0700 Subject: [PATCH 05/12] Set raindrops falling --- examples/acScripts/rain.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/examples/acScripts/rain.js b/examples/acScripts/rain.js index b2aa4427de..d7d0c9d44d 100644 --- a/examples/acScripts/rain.js +++ b/examples/acScripts/rain.js @@ -13,9 +13,10 @@ var RainSquall = function (properties) { var // Properties squallOrigin, squallRadius, - dropSize = { x: 0.1, y: 0.1, z: 0.1 }, - dropLifetime = 60, // Seconds dropsPerMinute = 60, + dropSize = { x: 0.1, y: 0.1, z: 0.1 }, + dropFallSpeed = 1, // m/s + dropLifetime = 60, // Seconds debug = false, // Display origin circle // Other squallCircle, @@ -39,16 +40,20 @@ var RainSquall = function (properties) { } squallRadius = properties.radius; + if (properties.hasOwnProperty("dropsPerMinute")) { + dropsPerMinute = properties.dropsPerMinute; + } + if (properties.hasOwnProperty("dropSize")) { dropSize = properties.dropSize; } - if (properties.hasOwnProperty("dropLifetime")) { - dropLifetime = properties.dropLifetime; + if (properties.hasOwnProperty("dropFallSpeed")) { + dropFallSpeed = properties.dropFallSpeed; } - if (properties.hasOwnProperty("dropsPerMinute")) { - dropsPerMinute = properties.dropsPerMinute; + if (properties.hasOwnProperty("dropLifetime")) { + dropLifetime = properties.dropLifetime; } if (properties.hasOwnProperty("debug")) { @@ -59,7 +64,10 @@ var RainSquall = function (properties) { type: "Model", modelURL: RAINDROP_MODEL_URL, lifetime: dropLifetime, - dimensions: dropSize + dimensions: dropSize, + velocity: { x: 0, y: -dropFallSpeed, z: 0 }, + damping: 0, + ignoreForCollisions: true }; } @@ -67,6 +75,7 @@ var RainSquall = function (properties) { var angle, radius, offset; + angle = Math.random() * 360; radius = Math.random() * squallRadius; offset = Vec3.multiplyQbyV(Quat.fromPitchYawRollDegrees(0, angle, 0), { x: 0, y: -0.1, z: radius }); @@ -104,8 +113,9 @@ var RainSquall = function (properties) { var rainSquall1 = new RainSquall({ origin: { x: 8192, y: 8200, z: 8192 }, radius: 2.5, - dropSize: { x: 0.1, y: 0.1, z: 0.1 }, - dropLifetime: 10, dropsPerMinute: 120, + dropSize: { x: 0.1, y: 0.1, z: 0.1 }, + dropFallSpeed: 2, // m/s + dropLifetime: 10, debug: true }); \ No newline at end of file From 10ac6bc9cadeb78baa2c344c7521eae2686bacf0 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Apr 2015 18:17:45 -0700 Subject: [PATCH 06/12] Don't render overlay unless debug --- examples/acScripts/rain.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/examples/acScripts/rain.js b/examples/acScripts/rain.js index d7d0c9d44d..6e03219934 100644 --- a/examples/acScripts/rain.js +++ b/examples/acScripts/rain.js @@ -17,7 +17,7 @@ var RainSquall = function (properties) { dropSize = { x: 0.1, y: 0.1, z: 0.1 }, dropFallSpeed = 1, // m/s dropLifetime = 60, // Seconds - debug = false, // Display origin circle + debug = false, // Display origin circle; don't use running on Stack Manager // Other squallCircle, SQUALL_CIRCLE_COLOR = { red: 255, green: 0, blue: 0 }, @@ -84,22 +84,26 @@ var RainSquall = function (properties) { } function setUp() { - squallCircle = Overlays.addOverlay("circle3d", { - size: { x: 2 * squallRadius, y: 2 * squallRadius }, - color: SQUALL_CIRCLE_COLOR, - alpha: SQUALL_CIRCLE_ALPHA, - solid: true, - visible: debug, - position: squallOrigin, - rotation: SQUALL_CIRCLE_ROTATION - }); + if (debug) { + squallCircle = Overlays.addOverlay("circle3d", { + size: { x: 2 * squallRadius, y: 2 * squallRadius }, + color: SQUALL_CIRCLE_COLOR, + alpha: SQUALL_CIRCLE_ALPHA, + solid: true, + visible: debug, + position: squallOrigin, + rotation: SQUALL_CIRCLE_ROTATION + }); + } raindropTimer = Script.setInterval(createRaindrop, 60000 / dropsPerMinute); } function tearDown() { Script.clearInterval(raindropTimer); - Overlays.deleteOverlay(squallCircle); + if (debug) { + Overlays.deleteOverlay(squallCircle); + } } processProperties(); From 54c0aeaa03a0bb7765c4cde0b0f8cef344b578d7 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Apr 2015 18:57:58 -0700 Subject: [PATCH 07/12] Work around entities not always getting velocity set at creation --- examples/acScripts/rain.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/examples/acScripts/rain.js b/examples/acScripts/rain.js index 6e03219934..fc7333fd65 100644 --- a/examples/acScripts/rain.js +++ b/examples/acScripts/rain.js @@ -25,7 +25,8 @@ var RainSquall = function (properties) { SQUALL_CIRCLE_ROTATION = Quat.fromPitchYawRollDegrees(90, 0, 0), raindropProperties, RAINDROP_MODEL_URL = "https://s3.amazonaws.com/hifi-public/ozan/Polyworld/Sets/sky/tetrahedron_v1-Faceted2.fbx", - raindropTimer; + raindropTimer, + rainDrops = []; function processProperties() { if (!properties.hasOwnProperty("origin")) { @@ -74,13 +75,26 @@ var RainSquall = function (properties) { function createRaindrop() { var angle, radius, - offset; + offset, + drop, + i; + + // HACK: Work around rain drops not always getting velocity set at creation + for (i = 0; i < rainDrops.length; i += 1) { + Entities.editEntity(rainDrops[i], { velocity: raindropProperties.velocity }); + } angle = Math.random() * 360; radius = Math.random() * squallRadius; offset = Vec3.multiplyQbyV(Quat.fromPitchYawRollDegrees(0, angle, 0), { x: 0, y: -0.1, z: radius }); raindropProperties.position = Vec3.sum(squallOrigin, offset); - Entities.addEntity(raindropProperties); + drop = Entities.addEntity(raindropProperties); + + // HACK: Work around rain drops not always getting velocity set at creation + rainDrops.push(drop); + if (rainDrops.length > 5) { + drop = rainDrops.shift(); + } } function setUp() { From d057573825f6d9c08fcf9c1ad6a88c625a5ee59d Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Apr 2015 19:38:15 -0700 Subject: [PATCH 08/12] Set raindrops spinning --- examples/acScripts/rain.js | 52 ++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/examples/acScripts/rain.js b/examples/acScripts/rain.js index fc7333fd65..ee8a1e19a6 100644 --- a/examples/acScripts/rain.js +++ b/examples/acScripts/rain.js @@ -17,6 +17,7 @@ var RainSquall = function (properties) { dropSize = { x: 0.1, y: 0.1, z: 0.1 }, dropFallSpeed = 1, // m/s dropLifetime = 60, // Seconds + dropSpinMax = 0, // Maximum angular velocity per axis; deg/s debug = false, // Display origin circle; don't use running on Stack Manager // Other squallCircle, @@ -26,7 +27,9 @@ var RainSquall = function (properties) { raindropProperties, RAINDROP_MODEL_URL = "https://s3.amazonaws.com/hifi-public/ozan/Polyworld/Sets/sky/tetrahedron_v1-Faceted2.fbx", raindropTimer, - rainDrops = []; + raindrops = [], // HACK: Work around raindrops not always getting velocities + raindropVelocities = [], // HACK: Work around raindrops not always getting velocities + DEGREES_TO_RADIANS = Math.PI / 180; function processProperties() { if (!properties.hasOwnProperty("origin")) { @@ -57,6 +60,10 @@ var RainSquall = function (properties) { dropLifetime = properties.dropLifetime; } + if (properties.hasOwnProperty("dropSpinMax")) { + dropSpinMax = properties.dropSpinMax; + } + if (properties.hasOwnProperty("debug")) { debug = properties.debug; } @@ -68,6 +75,7 @@ var RainSquall = function (properties) { dimensions: dropSize, velocity: { x: 0, y: -dropFallSpeed, z: 0 }, damping: 0, + angularDamping: 0, ignoreForCollisions: true }; } @@ -77,23 +85,38 @@ var RainSquall = function (properties) { radius, offset, drop, + spin = { x: 0, y: 0, z: 0 }, + maxSpinRadians = properties.dropSpinMax * DEGREES_TO_RADIANS, i; - // HACK: Work around rain drops not always getting velocity set at creation - for (i = 0; i < rainDrops.length; i += 1) { - Entities.editEntity(rainDrops[i], { velocity: raindropProperties.velocity }); + // HACK: Work around rain drops not always getting velocities set at creation + for (i = 0; i < raindrops.length; i += 1) { + Entities.editEntity(raindrops[i], raindropVelocities[i]); } angle = Math.random() * 360; radius = Math.random() * squallRadius; offset = Vec3.multiplyQbyV(Quat.fromPitchYawRollDegrees(0, angle, 0), { x: 0, y: -0.1, z: radius }); raindropProperties.position = Vec3.sum(squallOrigin, offset); + if (properties.dropSpinMax > 0) { + spin = { + x: Math.random() * maxSpinRadians, + y: Math.random() * maxSpinRadians, + z: Math.random() * maxSpinRadians + }; + raindropProperties.angularVelocity = spin; + } drop = Entities.addEntity(raindropProperties); - // HACK: Work around rain drops not always getting velocity set at creation - rainDrops.push(drop); - if (rainDrops.length > 5) { - drop = rainDrops.shift(); + // HACK: Work around rain drops not always getting velocities set at creation + raindrops.push(drop); + raindropVelocities.push({ + velocity: raindropProperties.velocity, + angularVelocity: spin + }); + if (raindrops.length > 5) { + raindrops.shift(); + raindropVelocities.shift(); } } @@ -129,11 +152,12 @@ var RainSquall = function (properties) { }; var rainSquall1 = new RainSquall({ - origin: { x: 8192, y: 8200, z: 8192 }, - radius: 2.5, + origin: { x: 1195, y: 1223, z: 1020 }, + radius: 25, dropsPerMinute: 120, dropSize: { x: 0.1, y: 0.1, z: 0.1 }, - dropFallSpeed: 2, // m/s - dropLifetime: 10, - debug: true -}); \ No newline at end of file + dropFallSpeed: 3, + dropLifetime: 30, + dropSpinMax: 180, + debug: false +}); From f8e4ff8072409e5fad07d4b1ca9682eb74755e58 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 15 Apr 2015 09:54:30 -0700 Subject: [PATCH 09/12] Update Application:stopAllScripts to skip finished scripts --- interface/src/Application.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4892019ae5..4328be21b4 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3889,6 +3889,9 @@ void Application::stopAllScripts(bool restart) { // stops all current running scripts for (QHash::const_iterator it = _scriptEnginesHash.constBegin(); it != _scriptEnginesHash.constEnd(); it++) { + if (it.value()->isFinished()) { + continue; + } if (restart && it.value()->isUserLoaded()) { connect(it.value(), SIGNAL(finished(const QString&)), SLOT(loadScript(const QString&))); } From 2e61ef01daf61ca39fc265d2214c1c6b36112f04 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 15 Apr 2015 09:55:36 -0700 Subject: [PATCH 10/12] Update ScriptEngin::stop to only take effect when not finished --- libraries/script-engine/src/ScriptEngine.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index 2f9427a63d..ac2c212001 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -647,8 +647,10 @@ void ScriptEngine::stopAllTimers() { } void ScriptEngine::stop() { - _isFinished = true; - emit runningStateChanged(); + if (!_isFinished) { + _isFinished = true; + emit runningStateChanged(); + } } void ScriptEngine::timerFired() { From 2f970ae9622197f461ea8037b0f94f22d1da76d7 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 15 Apr 2015 11:07:00 -0700 Subject: [PATCH 11/12] Terminate DDE process gracefully --- interface/src/devices/DdeFaceTracker.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/devices/DdeFaceTracker.cpp b/interface/src/devices/DdeFaceTracker.cpp index a701160198..c7a8b7d166 100644 --- a/interface/src/devices/DdeFaceTracker.cpp +++ b/interface/src/devices/DdeFaceTracker.cpp @@ -182,9 +182,10 @@ void DdeFaceTracker::setEnabled(bool enabled) { _udpSocket.bind(_host, _serverPort); } + const char* DDE_EXIT_COMMAND = "exit"; + if (enabled && !_ddeProcess) { // Terminate any existing DDE process, perhaps left running after an Interface crash - const char* DDE_EXIT_COMMAND = "exit"; _udpSocket.writeDatagram(DDE_EXIT_COMMAND, DDE_SERVER_ADDR, _controlPort); qDebug() << "[Info] DDE Face Tracker Starting"; @@ -194,7 +195,8 @@ void DdeFaceTracker::setEnabled(bool enabled) { } if (!enabled && _ddeProcess) { - _ddeProcess->kill(); // More robust than trying to send an "exit" command to DDE + _udpSocket.writeDatagram(DDE_EXIT_COMMAND, DDE_SERVER_ADDR, _controlPort); + delete _ddeProcess; _ddeProcess = NULL; qDebug() << "[Info] DDE Face Tracker Stopped"; } From 41e7b75a8d01b3e64dc7362feb445a9829d30470 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 16 Apr 2015 17:14:18 -0700 Subject: [PATCH 12/12] revert mac version of HMD tools back to meta-H --- interface/src/Menu.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index d50cb48118..bde0745c4d 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -235,33 +235,33 @@ Menu::Menu() { QMenu* viewMenu = addMenu("View"); + addCheckableActionToQMenuAndActionHash(viewMenu, + MenuOption::Fullscreen, #ifdef Q_OS_MAC - addCheckableActionToQMenuAndActionHash(viewMenu, - MenuOption::Fullscreen, Qt::CTRL | Qt::META | Qt::Key_F, - false, - qApp, - SLOT(setFullscreen(bool))); #else - addCheckableActionToQMenuAndActionHash(viewMenu, - MenuOption::Fullscreen, Qt::CTRL | Qt::Key_F, +#endif false, qApp, SLOT(setFullscreen(bool))); -#endif + addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FirstPerson, Qt::Key_P, true, qApp,SLOT(cameraMenuChanged())); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Mirror, Qt::SHIFT | Qt::Key_H, true); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FullscreenMirror, Qt::Key_H, false, qApp, SLOT(cameraMenuChanged())); - addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::HMDTools, Qt::CTRL | Qt::Key_H, + addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::HMDTools, +#ifdef Q_OS_MAC + Qt::META | Qt::Key_H, +#else + Qt::CTRL | Qt::Key_H, +#endif false, dialogsManager.data(), SLOT(hmdTools(bool))); - addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::EnableVRMode, 0, false, qApp,