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
95 95
96 vr::RenderModel_t model;96 vr::RenderModel_t model;
97 if (!_hmd->LoadRenderModel(CONTROLLER_MODEL_STRING.toStdString().c_str(), &model)) {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 } else {99 } else {
100 model::Mesh* mesh = new model::Mesh();100 model::Mesh* mesh = new model::Mesh();
101 model::MeshPointer meshPtr(mesh);101 model::MeshPointer meshPtr(mesh);
@@ -198,7 +198,7 @@ void ViveControllerManager::renderHand(UserInputMapper::PoseValue pose, gpu::Bat · 96 unmodified lines
198 Transform transform(userInputMapper->getSensorToWorldMat());198 Transform transform(userInputMapper->getSensorToWorldMat());
199 transform.postTranslate(pose.getTranslation() + pose.getRotation() * glm::vec3(0, 0, CONTROLLER_LENGTH_OFFSET));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 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));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 transform.postRotate(rotation);203 transform.postRotate(rotation);
204 204
@@ -325,7 +325,7 @@ void ViveControllerManager::handlePoseEvent(const mat4& mat, int index) { · 120 unmodified lines
325 glm::quat rotation = glm::quat_cast(mat);325 glm::quat rotation = glm::quat_cast(mat);
326 326
327 // Flip the rotation appropriately for each hand327 // 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 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));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 position += rotation * glm::vec3(0, 0, -CONTROLLER_LENGTH_OFFSET);331 position += rotation * glm::vec3(0, 0, -CONTROLLER_LENGTH_OFFSET);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t