Showing the changes to libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp (1 of 28 files). Show all
Unified · Split
| @@ -95,7 +95,7 @@ void ViveControllerManager::activate() { · 94 unmodified lines | ||
| 95 | 95 | |
| 96 | 96 | vr::RenderModel_t model; |
| 97 | 97 | if (!_hmd->LoadRenderModel(CONTROLLER_MODEL_STRING.toStdString().c_str(), &model)) { |
| 98 | − qDebug("Unable to load render model %s\n", CONTROLLER_MODEL_STRING); | |
| 98 | + qDebug() << QString("Unable to load render model %1\n").arg(CONTROLLER_MODEL_STRING); | |
| 99 | 99 | } else { |
| 100 | 100 | model::Mesh* mesh = new model::Mesh(); |
| 101 | 101 | model::MeshPointer meshPtr(mesh); |
| @@ -198,7 +198,7 @@ void ViveControllerManager::renderHand(UserInputMapper::PoseValue pose, gpu::Bat · 96 unmodified lines | ||
| 198 | 198 | Transform transform(userInputMapper->getSensorToWorldMat()); |
| 199 | 199 | transform.postTranslate(pose.getTranslation() + pose.getRotation() * glm::vec3(0, 0, CONTROLLER_LENGTH_OFFSET)); |
| 200 | 200 | |
| 201 | − int sign = index == LEFT_HAND ? 1.0f : -1.0f; | |
| 201 | + int sign = index == LEFT_HAND ? 1 : -1; | |
| 202 | 202 | glm::quat rotation = pose.getRotation() * glm::angleAxis(PI, glm::vec3(1.0f, 0.0f, 0.0f)) * glm::angleAxis(sign * PI_OVER_TWO, glm::vec3(0.0f, 0.0f, 1.0f)); |
| 203 | 203 | transform.postRotate(rotation); |
| 204 | 204 | |
| @@ -325,7 +325,7 @@ void ViveControllerManager::handlePoseEvent(const mat4& mat, int index) { · 120 unmodified lines | ||
| 325 | 325 | glm::quat rotation = glm::quat_cast(mat); |
| 326 | 326 | |
| 327 | 327 | // Flip the rotation appropriately for each hand |
| 328 | − int sign = index == LEFT_HAND ? 1.0f : -1.0f; | |
| 328 | + int sign = index == LEFT_HAND ? 1 : -1; | |
| 329 | 329 | rotation = rotation * glm::angleAxis(PI, glm::vec3(1.0f, 0.0f, 0.0f)) * glm::angleAxis(sign * PI_OVER_TWO, glm::vec3(0.0f, 0.0f, 1.0f)); |
| 330 | 330 | |
| 331 | 331 | position += rotation * glm::vec3(0, 0, -CONTROLLER_LENGTH_OFFSET); |