History

Fixing problems reported by static analysis tool

Brad Davis committed 11 years ago

Commit d311e4f1 parent 08ee5cb28 files · +88 −52Browse files

Showing the changes to libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp (1 of 28 files). Show all

Unified · Split

libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp+3−3
@@ -95,7 +95,7 @@ void ViveControllerManager::activate() { · 94 unmodified lines
9595
9696 vr::RenderModel_t model;
9797 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);
9999 } else {
100100 model::Mesh* mesh = new model::Mesh();
101101 model::MeshPointer meshPtr(mesh);
@@ -198,7 +198,7 @@ void ViveControllerManager::renderHand(UserInputMapper::PoseValue pose, gpu::Bat · 96 unmodified lines
198198 Transform transform(userInputMapper->getSensorToWorldMat());
199199 transform.postTranslate(pose.getTranslation() + pose.getRotation() * glm::vec3(0, 0, CONTROLLER_LENGTH_OFFSET));
200200
201− int sign = index == LEFT_HAND ? 1.0f : -1.0f;
201+ int sign = index == LEFT_HAND ? 1 : -1;
202202 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));
203203 transform.postRotate(rotation);
204204
@@ -325,7 +325,7 @@ void ViveControllerManager::handlePoseEvent(const mat4& mat, int index) { · 120 unmodified lines
325325 glm::quat rotation = glm::quat_cast(mat);
326326
327327 // 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;
329329 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));
330330
331331 position += rotation * glm::vec3(0, 0, -CONTROLLER_LENGTH_OFFSET);