keyboard touch ups

This commit is contained in:
Dante Ruiz 2018-11-14 16:12:34 -08:00
parent d19cdc62d7
commit a77121a588
6 changed files with 32 additions and 28 deletions

View file

@ -701,9 +701,9 @@
"y": 0.04787999764084816 "y": 0.04787999764084816
}, },
"position": { "position": {
"x": -0.53203323516845703, "x": -0.59333323516845703,
"y": 0.019300000742077827, "y": 0.019300000742077827,
"z": -0.07286686894893646 "z": 0.037454843521118164
}, },
"modelURL": "meshes/keyboard/SM_key.fbx", "modelURL": "meshes/keyboard/SM_key.fbx",
"texture": { "texture": {
@ -752,7 +752,7 @@
"y": 0.04787999764084816 "y": 0.04787999764084816
}, },
"position": { "position": {
"x": -0.59333323516845703, "x": -0.65333323516845703,
"y": 0.019300000742077827, "y": 0.019300000742077827,
"z": 0.037454843521118164 "z": 0.037454843521118164
}, },
@ -777,9 +777,9 @@
"y": 0.04787999764084816 "y": 0.04787999764084816
}, },
"position": { "position": {
"x": -0.5103323516845703, "x": -0.5503323516845703,
"y": 0.019300000742077827, "y": 0.019300000742077827,
"z": -0.127054843521118164 "z": -0.07282185554504395
}, },
"modelURL": "meshes/keyboard/SM_enter.fbx", "modelURL": "meshes/keyboard/SM_enter.fbx",
"texture": { "texture": {
@ -1479,9 +1479,9 @@
"y": 0.04787999764084816 "y": 0.04787999764084816
}, },
"position": { "position": {
"x": -0.53203323516845703, "x": -0.59333323516845703,
"y": 0.019300000742077827, "y": 0.019300000742077827,
"z": -0.07286686894893646 "z": 0.037454843521118164
}, },
"modelURL": "meshes/keyboard/SM_key.fbx", "modelURL": "meshes/keyboard/SM_key.fbx",
"texture": { "texture": {
@ -1530,7 +1530,7 @@
"y": 0.04787999764084816 "y": 0.04787999764084816
}, },
"position": { "position": {
"x": -0.59333323516845703, "x": -0.65333323516845703,
"y": 0.019300000742077827, "y": 0.019300000742077827,
"z": 0.037454843521118164 "z": 0.037454843521118164
}, },
@ -1555,9 +1555,9 @@
"y": 0.04787999764084816 "y": 0.04787999764084816
}, },
"position": { "position": {
"x": -0.5103323516845703, "x": -0.5503323516845703,
"y": 0.019300000742077827, "y": 0.019300000742077827,
"z": -0.127054843521118164 "z": -0.07282185554504395
}, },
"modelURL": "meshes/keyboard/SM_enter.fbx", "modelURL": "meshes/keyboard/SM_enter.fbx",
"texture": { "texture": {
@ -2305,9 +2305,9 @@
"y": 0.04787999764084816 "y": 0.04787999764084816
}, },
"position": { "position": {
"x": -0.53203323516845703, "x": -0.59333323516845703,
"y": 0.019300000742077827, "y": 0.019300000742077827,
"z": -0.07286686894893646 "z": 0.037454843521118164
}, },
"modelURL": "meshes/keyboard/SM_key.fbx", "modelURL": "meshes/keyboard/SM_key.fbx",
"texture": { "texture": {
@ -2356,7 +2356,7 @@
"y": 0.04787999764084816 "y": 0.04787999764084816
}, },
"position": { "position": {
"x": -0.59333323516845703, "x": -0.65333323516845703,
"y": 0.019300000742077827, "y": 0.019300000742077827,
"z": 0.037454843521118164 "z": 0.037454843521118164
}, },
@ -2381,9 +2381,9 @@
"y": 0.04787999764084816 "y": 0.04787999764084816
}, },
"position": { "position": {
"x": -0.5103323516845703, "x": -0.5503323516845703,
"y": 0.019300000742077827, "y": 0.019300000742077827,
"z": -0.127054843521118164 "z": -0.07282185554504395
}, },
"modelURL": "meshes/keyboard/SM_enter.fbx", "modelURL": "meshes/keyboard/SM_enter.fbx",
"texture": { "texture": {

Binary file not shown.

View file

@ -45,6 +45,7 @@
#include "scripting/HMDScriptingInterface.h" #include "scripting/HMDScriptingInterface.h"
#include "scripting/WindowScriptingInterface.h" #include "scripting/WindowScriptingInterface.h"
#include "scripting/SelectionScriptingInterface.h" #include "scripting/SelectionScriptingInterface.h"
#include "scripting/HMDScriptingInterface.h"
#include "DependencyManager.h" #include "DependencyManager.h"
#include "raypick/StylusPointer.h" #include "raypick/StylusPointer.h"
@ -54,9 +55,9 @@
static const int LEFT_HAND_CONTROLLER_INDEX = 0; static const int LEFT_HAND_CONTROLLER_INDEX = 0;
static const int RIGHT_HAND_CONTROLLER_INDEX = 1; static const int RIGHT_HAND_CONTROLLER_INDEX = 1;
static const float MALLET_LENGTH = 0.2f; static const float MALLET_LENGTH = 0.18f;
static const float MALLET_TOUCH_Y_OFFSET = 0.052f; static const float MALLET_TOUCH_Y_OFFSET = 0.050f;
static const float MALLET_Y_OFFSET = 0.180f; static const float MALLET_Y_OFFSET = 0.160f;
static const glm::quat MALLET_ROTATION_OFFSET{0.70710678f, 0.0f, -0.70710678f, 0.0f}; static const glm::quat MALLET_ROTATION_OFFSET{0.70710678f, 0.0f, -0.70710678f, 0.0f};
static const glm::vec3 MALLET_MODEL_DIMENSIONS{0.03f, MALLET_LENGTH, 0.03f}; static const glm::vec3 MALLET_MODEL_DIMENSIONS{0.03f, MALLET_LENGTH, 0.03f};
@ -65,14 +66,14 @@ static const glm::vec3 MALLET_TIP_OFFSET{0.0f, MALLET_LENGTH - MALLET_TOUCH_Y_OF
static const glm::vec3 Z_AXIS {0.0f, 0.0f, 1.0f}; static const glm::vec3 Z_AXIS {0.0f, 0.0f, 1.0f};
static const glm::vec3 KEYBOARD_TABLET_OFFSET{0.28f, -0.3f, -0.05f}; static const glm::vec3 KEYBOARD_TABLET_OFFSET{0.30f, -0.38f, -0.04f};
static const glm::vec3 KEYBOARD_TABLET_DEGREES_OFFSET{-45.0f, 0.0f, 0.0f}; static const glm::vec3 KEYBOARD_TABLET_DEGREES_OFFSET{-45.0f, 0.0f, 0.0f};
static const glm::vec3 KEYBOARD_TABLET_LANDSCAPE_OFFSET{-0.2f, -0.27f, -0.05f}; static const glm::vec3 KEYBOARD_TABLET_LANDSCAPE_OFFSET{-0.2f, -0.27f, -0.05f};
static const glm::vec3 KEYBOARD_TABLET_LANDSCAPE_DEGREES_OFFSET{-45.0f, 0.0f, -90.0f}; static const glm::vec3 KEYBOARD_TABLET_LANDSCAPE_DEGREES_OFFSET{-45.0f, 0.0f, -90.0f};
static const glm::vec3 KEYBOARD_AVATAR_OFFSET{-0.6f, 0.3f, -0.7f}; static const glm::vec3 KEYBOARD_AVATAR_OFFSET{-0.6f, 0.3f, -0.7f};
static const glm::vec3 KEYBOARD_AVATAR_DEGREES_OFFSET{0.0f, 180.0f, 0.0f}; static const glm::vec3 KEYBOARD_AVATAR_DEGREES_OFFSET{0.0f, 180.0f, 0.0f};
static const QString SOUND_FILE = PathUtils::resourcesUrl() + "sounds/keyboard_key.mp3"; static const QString SOUND_FILE = PathUtils::resourcesUrl() + "sounds/keyboardPress.mp3";
static const QString MALLET_MODEL_URL = PathUtils::resourcesUrl() + "meshes/drumstick.fbx"; static const QString MALLET_MODEL_URL = PathUtils::resourcesUrl() + "meshes/drumstick.fbx";
static const float PULSE_STRENGTH = 0.6f; static const float PULSE_STRENGTH = 0.6f;
@ -221,6 +222,7 @@ Keyboard::Keyboard() {
auto pointerManager = DependencyManager::get<PointerManager>(); auto pointerManager = DependencyManager::get<PointerManager>();
auto windowScriptingInterface = DependencyManager::get<WindowScriptingInterface>(); auto windowScriptingInterface = DependencyManager::get<WindowScriptingInterface>();
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar(); auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
auto hmdScriptingInterface = DependencyManager::get<HMDScriptingInterface>();
connect(pointerManager.data(), &PointerManager::triggerBeginOverlay, this, &Keyboard::handleTriggerBegin, Qt::QueuedConnection); connect(pointerManager.data(), &PointerManager::triggerBeginOverlay, this, &Keyboard::handleTriggerBegin, Qt::QueuedConnection);
connect(pointerManager.data(), &PointerManager::triggerContinueOverlay, this, &Keyboard::handleTriggerContinue, Qt::QueuedConnection); connect(pointerManager.data(), &PointerManager::triggerContinueOverlay, this, &Keyboard::handleTriggerContinue, Qt::QueuedConnection);
connect(pointerManager.data(), &PointerManager::triggerEndOverlay, this, &Keyboard::handleTriggerEnd, Qt::QueuedConnection); connect(pointerManager.data(), &PointerManager::triggerEndOverlay, this, &Keyboard::handleTriggerEnd, Qt::QueuedConnection);
@ -228,6 +230,7 @@ Keyboard::Keyboard() {
connect(pointerManager.data(), &PointerManager::hoverEndOverlay, this, &Keyboard::handleHoverEnd, Qt::QueuedConnection); connect(pointerManager.data(), &PointerManager::hoverEndOverlay, this, &Keyboard::handleHoverEnd, Qt::QueuedConnection);
connect(myAvatar.get(), &MyAvatar::sensorToWorldScaleChanged, this, &Keyboard::scaleKeyboard, Qt::QueuedConnection); connect(myAvatar.get(), &MyAvatar::sensorToWorldScaleChanged, this, &Keyboard::scaleKeyboard, Qt::QueuedConnection);
connect(windowScriptingInterface.data(), &WindowScriptingInterface::domainChanged, [&]() { setRaised(false); }); connect(windowScriptingInterface.data(), &WindowScriptingInterface::domainChanged, [&]() { setRaised(false); });
connect(hmdScriptingInterface.data(), &HMDScriptingInterface::displayModeChanged, [&]() { setRaised(false); });
} }
void Keyboard::registerKeyboardHighlighting() { void Keyboard::registerKeyboardHighlighting() {
@ -483,7 +486,7 @@ void Keyboard::handleTriggerBegin(const OverlayID& overlayID, const PointerEvent
AudioInjectorOptions audioOptions; AudioInjectorOptions audioOptions;
audioOptions.localOnly = true; audioOptions.localOnly = true;
audioOptions.position = keyWorldPosition; audioOptions.position = keyWorldPosition;
audioOptions.volume = 0.1f; audioOptions.volume = 0.05f;
AudioInjector::playSoundAndDelete(_keySound, audioOptions); AudioInjector::playSoundAndDelete(_keySound, audioOptions);
@ -835,8 +838,8 @@ void Keyboard::loadKeyboardFile(const QString& keyboardFile) {
_textDisplay = textDisplay; _textDisplay = textDisplay;
_ignoreItemsLock.withWriteLock([&] { _ignoreItemsLock.withWriteLock([&] {
_itemsToIgnore.push_back(_textDisplay.overlayID); _itemsToIgnore.append(_textDisplay.overlayID);
_itemsToIgnore.push_back(_anchor.overlayID); _itemsToIgnore.append(_anchor.overlayID);
}); });
_layerIndex = 0; _layerIndex = 0;
auto pointerManager = DependencyManager::get<PointerManager>(); auto pointerManager = DependencyManager::get<PointerManager>();

View file

@ -535,7 +535,7 @@ RayToOverlayIntersectionResult Overlays::findRayIntersectionVector(const PickRay
bool bestIsFront = false; bool bestIsFront = false;
bool bestIsTablet = false; bool bestIsTablet = false;
auto tabletIDs = qApp->getTabletIDs(); auto tabletIDs = qApp->getTabletIDs();
const QVector<OverlayID> keyboardKeysToDiscard = DependencyManager::get<Keyboard>()->getKeysID();
QMutexLocker locker(&_mutex); QMutexLocker locker(&_mutex);
RayToOverlayIntersectionResult result; RayToOverlayIntersectionResult result;
QMapIterator<OverlayID, Overlay::Pointer> i(_overlaysWorld); QMapIterator<OverlayID, Overlay::Pointer> i(_overlaysWorld);
@ -545,7 +545,8 @@ RayToOverlayIntersectionResult Overlays::findRayIntersectionVector(const PickRay
auto thisOverlay = std::dynamic_pointer_cast<Base3DOverlay>(i.value()); auto thisOverlay = std::dynamic_pointer_cast<Base3DOverlay>(i.value());
if ((overlaysToDiscard.size() > 0 && overlaysToDiscard.contains(thisID)) || if ((overlaysToDiscard.size() > 0 && overlaysToDiscard.contains(thisID)) ||
(overlaysToInclude.size() > 0 && !overlaysToInclude.contains(thisID))) { (overlaysToInclude.size() > 0 && !overlaysToInclude.contains(thisID)) ||
(keyboardKeysToDiscard.size() > 0 && keyboardKeysToDiscard.contains(thisID))) {
continue; continue;
} }