History

Don't bother with testing the ignore orientations stuff.

Andrzej Kapolka committed 13 years ago

Commit 5194fb21 parent 04b72e31 file · +5 −14Browse files

Showing the changes to interface/src/AvatarVoxelSystem.cpp (1 of 1 file). Show all

Unified · Split

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

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