Showing the changes to interface/src/AvatarVoxelSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -83,18 +83,13 @@ public: · 82 unmodified lines | ||
| 83 | 83 | bool bindVoxelsTogether; |
| 84 | 84 | int maxBonesPerBind; |
| 85 | 85 | bool includeBonesOutsideBindRadius; |
| 86 | − bool ignoreOrientations; | |
| 87 | 86 | }; |
| 88 | 87 | |
| 89 | 88 | const Mode MODES[] = { |
| 90 | − { false, BONE_ELEMENTS_PER_VERTEX, false, false }, // original | |
| 91 | − { false, 1, true, false }, // one bone per vertex | |
| 92 | − { true, 1, true, false }, // one bone per voxel | |
| 93 | − { true, BONE_ELEMENTS_PER_VERTEX, false, false }, // four bones per voxel | |
| 94 | − { false, BONE_ELEMENTS_PER_VERTEX, false, true }, // no orientations | |
| 95 | − { false, 1, true, true }, // no orientations, one bone per vertex | |
| 96 | − { true, 1, true, true }, // no orientations, one bone per voxel | |
| 97 | − { true, BONE_ELEMENTS_PER_VERTEX, false, true } }; // no orientations, four bones per voxel | |
| 89 | + { false, BONE_ELEMENTS_PER_VERTEX, false }, // original | |
| 90 | + { false, 1, true }, // one bone per vertex | |
| 91 | + { true, 1, true }, // one bone per voxel | |
| 92 | + { true, BONE_ELEMENTS_PER_VERTEX, false } }; // four bones per voxel | |
| 98 | 93 | |
| 99 | 94 | void AvatarVoxelSystem::cycleMode() { |
| 100 | 95 | _mode = (_mode + 1) % (sizeof(MODES) / sizeof(MODES[0])); |
| @@ -221,11 +216,7 @@ void AvatarVoxelSystem::applyScaleAndBindProgram(bool texture) { · 120 unmodified lines | ||
| 221 | 216 | glm::quat orientation; |
| 222 | 217 | _avatar->getBodyBallTransform((AvatarJointID)i, position, orientation); |
| 223 | 218 | boneMatrices[i].translate(position.x, position.y, position.z); |
| 224 | − if (MODES[_mode].ignoreOrientations) { | |
| 225 | − orientation = _avatar->getOrientation(); | |
| 226 | − } else { | |
| 227 | − orientation = orientation * glm::inverse(_avatar->getSkeleton().joint[i].absoluteBindPoseRotation); | |
| 228 | − } | |
| 219 | + orientation = orientation * glm::inverse(_avatar->getSkeleton().joint[i].absoluteBindPoseRotation); | |
| 229 | 220 | boneMatrices[i].rotate(QQuaternion(orientation.w, orientation.x, orientation.y, orientation.z)); |
| 230 | 221 | const glm::vec3& bindPosition = _avatar->getSkeleton().joint[i].absoluteBindPosePosition; |
| 231 | 222 | boneMatrices[i].translate(-bindPosition.x, -bindPosition.y, -bindPosition.z); |