History

a little more cleanup

Brad Hefta-Gaub committed 11 years ago

Commit 65eae351 parent 7f313e73 files · +10 −42Browse files

Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 3 files). Show all

Unified · Split

interface/src/avatar/SkeletonModel.cpp+10−21
@@ -236,20 +236,15 @@ void SkeletonModel::simulate(float deltaTime, bool fullUpdate) { · 235 unmodified lines
236236
237237 const FBXGeometry& geometry = _geometry->getFBXGeometry();
238238
239− // find the left and rightmost active palms
240− int leftPalmIndex, rightPalmIndex;
241− Hand* hand = _owningAvatar->getHand();
242−
243− // FIXME - it's possible that the left/right hand indices could change between this call
244− // and the call to hand->getCopyOfPalms(); This logic should be reworked to only operate on
245− // the copy of the palms data
246− hand->getLeftRightPalmIndices(leftPalmIndex, rightPalmIndex);
247−
248239 // Don't Relax toward hand positions when in animGraph mode.
249240 if (!_rig->getEnableAnimGraph()) {
250− auto palms = hand->getCopyOfPalms();
241+
242+ Hand* hand = _owningAvatar->getHand();
243+ auto leftPalm = hand->getCopyOfPalmData(HandData::LeftHand);
244+ auto rightPalm = hand->getCopyOfPalmData(HandData::RightHand);
245+
251246 const float HAND_RESTORATION_RATE = 0.25f;
252− if (leftPalmIndex == -1 && rightPalmIndex == -1) {
247+ if (!leftPalm.isActive() && !rightPalm.isActive()) {
253248 // palms are not yet set, use mouse
254249 if (_owningAvatar->getHandState() == HAND_STATE_NULL) {
255250 restoreRightHandPosition(HAND_RESTORATION_RATE, PALM_PRIORITY);
@@ -259,20 +254,14 @@ void SkeletonModel::simulate(float deltaTime, bool fullUpdate) { · 3 unmodified lines
259254 applyHandPosition(geometry.rightHandJointIndex, handPosition);
260255 }
261256 restoreLeftHandPosition(HAND_RESTORATION_RATE, PALM_PRIORITY);
262−
263− } else if (leftPalmIndex == rightPalmIndex) {
264− // right hand only
265− applyPalmData(geometry.rightHandJointIndex, palms[leftPalmIndex]);
266− restoreLeftHandPosition(HAND_RESTORATION_RATE, PALM_PRIORITY);
267−
268257 } else {
269− if (leftPalmIndex != -1) {
270− applyPalmData(geometry.leftHandJointIndex, palms[leftPalmIndex]);
258+ if (leftPalm.isActive()) {
259+ applyPalmData(geometry.leftHandJointIndex, leftPalm);
271260 } else {
272261 restoreLeftHandPosition(HAND_RESTORATION_RATE, PALM_PRIORITY);
273262 }
274− if (rightPalmIndex != -1) {
275− applyPalmData(geometry.rightHandJointIndex, palms[rightPalmIndex]);
263+ if (rightPalm.isActive()) {
264+ applyPalmData(geometry.rightHandJointIndex, rightPalm);
276265 } else {
277266 restoreRightHandPosition(HAND_RESTORATION_RATE, PALM_PRIORITY);
278267 }

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