From 7050139a56bcd90c32b4e592e8561b7017647ac2 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 10 Nov 2015 13:41:19 -0800 Subject: [PATCH] Bit of code cleanup --- interface/src/avatar/AvatarActionHold.cpp | 21 ++++++++----------- interface/src/avatar/AvatarActionHold.h | 7 ++++--- .../input-plugins/ViveControllerManager.cpp | 18 +++++++++------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/interface/src/avatar/AvatarActionHold.cpp b/interface/src/avatar/AvatarActionHold.cpp index 9384cc2216..12759d5208 100644 --- a/interface/src/avatar/AvatarActionHold.cpp +++ b/interface/src/avatar/AvatarActionHold.cpp @@ -9,31 +9,28 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include "QVariantGLM.h" +#include "AvatarActionHold.h" + +#include + #include "avatar/MyAvatar.h" #include "avatar/AvatarManager.h" -#include "AvatarActionHold.h" - const uint16_t AvatarActionHold::holdVersion = 1; AvatarActionHold::AvatarActionHold(const QUuid& id, EntityItemPointer ownerEntity) : - ObjectActionSpring(id, ownerEntity), - _relativePosition(glm::vec3(0.0f)), - _relativeRotation(glm::quat()), - _hand("right"), - _holderID(QUuid()) + ObjectActionSpring(id, ownerEntity) { _type = ACTION_TYPE_HOLD; - #if WANT_DEBUG +#if WANT_DEBUG qDebug() << "AvatarActionHold::AvatarActionHold"; - #endif +#endif } AvatarActionHold::~AvatarActionHold() { - #if WANT_DEBUG +#if WANT_DEBUG qDebug() << "AvatarActionHold::~AvatarActionHold"; - #endif +#endif } void AvatarActionHold::updateActionWorker(float deltaTimeStep) { diff --git a/interface/src/avatar/AvatarActionHold.h b/interface/src/avatar/AvatarActionHold.h index 15a096d1ce..ec1df2f0e0 100644 --- a/interface/src/avatar/AvatarActionHold.h +++ b/interface/src/avatar/AvatarActionHold.h @@ -35,12 +35,13 @@ public: private: static const uint16_t holdVersion; - glm::vec3 _relativePosition; + void doKinematicUpdate(float deltaTimeStep); + + glm::vec3 _relativePosition { 0.0f }; glm::quat _relativeRotation; - QString _hand; + QString _hand { "right" }; QUuid _holderID; - void doKinematicUpdate(float deltaTimeStep); bool _kinematic { false }; bool _kinematicSetVelocity { false }; bool _previousSet { false }; diff --git a/libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp b/libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp index 7d8ff22f73..9c95bb9426 100644 --- a/libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp +++ b/libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp @@ -35,17 +35,19 @@ vr::IVRSystem* acquireOpenVrSystem(); void releaseOpenVrSystem(); -const float CONTROLLER_LENGTH_OFFSET = 0.0762f; // three inches -const glm::vec3 CONTROLLER_OFFSET = glm::vec3(CONTROLLER_LENGTH_OFFSET / 2.0f, CONTROLLER_LENGTH_OFFSET / 2.0f, 2.0f * CONTROLLER_LENGTH_OFFSET); // three inches -const QString CONTROLLER_MODEL_STRING = "vr_controller_05_wireless_b"; +static const float CONTROLLER_LENGTH_OFFSET = 0.0762f; // three inches +static const glm::vec3 CONTROLLER_OFFSET = glm::vec3(CONTROLLER_LENGTH_OFFSET / 2.0f, + CONTROLLER_LENGTH_OFFSET / 2.0f, + CONTROLLER_LENGTH_OFFSET * 2.0f); +static const QString CONTROLLER_MODEL_STRING = "vr_controller_05_wireless_b"; + +static const QString MENU_PARENT = "Avatar"; +static const QString MENU_NAME = "Vive Controllers"; +static const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME; +static const QString RENDER_CONTROLLERS = "Render Hand Controllers"; const QString ViveControllerManager::NAME = "OpenVR"; -const QString MENU_PARENT = "Avatar"; -const QString MENU_NAME = "Vive Controllers"; -const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME; -const QString RENDER_CONTROLLERS = "Render Hand Controllers"; - bool ViveControllerManager::isSupported() const { #ifdef Q_OS_WIN auto hmd = acquireOpenVrSystem();