mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 23:17:02 +02:00
Fix Leap finger joints
This commit is contained in:
parent
c9c3ab985a
commit
cf3d2c7b4a
1 changed files with 13 additions and 6 deletions
|
@ -407,19 +407,26 @@ var leapHands = (function () {
|
||||||
MyAvatar.setJointModelPositionAndOrientation(hands[h].jointName, handOffset, handRotation, true);
|
MyAvatar.setJointModelPositionAndOrientation(hands[h].jointName, handOffset, handRotation, true);
|
||||||
|
|
||||||
// Finger joints ...
|
// Finger joints ...
|
||||||
// TODO: 2.0 * scale factors should not be necessary; Leap Motion controller code needs investigating.
|
|
||||||
for (i = 0; i < NUM_FINGERS; i += 1) {
|
for (i = 0; i < NUM_FINGERS; i += 1) {
|
||||||
for (j = 0; j < NUM_FINGER_JOINTS; j += 1) {
|
for (j = 0; j < NUM_FINGER_JOINTS; j += 1) {
|
||||||
if (fingers[h][i][j].controller !== null) {
|
if (fingers[h][i][j].controller !== null) {
|
||||||
locRotation = fingers[h][i][j].controller.getLocRotation();
|
locRotation = fingers[h][i][j].controller.getLocRotation();
|
||||||
if (i === THUMB) {
|
if (i === THUMB) {
|
||||||
MyAvatar.setJointData(fingers[h][i][j].jointName,
|
locRotation = {
|
||||||
Quat.fromPitchYawRollRadians(2.0 * side * locRotation.y, 2.0 * -locRotation.z,
|
x: side * locRotation.y,
|
||||||
2.0 * side * -locRotation.x));
|
y: side * -locRotation.z,
|
||||||
|
z: side * -locRotation.x,
|
||||||
|
w: locRotation.w
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
MyAvatar.setJointData(fingers[h][i][j].jointName,
|
locRotation = {
|
||||||
Quat.fromPitchYawRollRadians(2.0 * -locRotation.x, 0.0, 2.0 * -locRotation.y));
|
x: -locRotation.x,
|
||||||
|
y: -locRotation.z,
|
||||||
|
z: -locRotation.y,
|
||||||
|
w: locRotation.w
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
MyAvatar.setJointData(fingers[h][i][j].jointName, locRotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue