mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 03:19:24 +02:00
Fix hand and finger joint control in leapHands.js for HMD mode
This commit is contained in:
parent
6736eefbc1
commit
566b27156c
1 changed files with 5 additions and 14 deletions
|
@ -381,23 +381,14 @@ var leapHands = (function () {
|
||||||
|
|
||||||
// Hand rotation in camera coordinates ...
|
// Hand rotation in camera coordinates ...
|
||||||
handRotation = {
|
handRotation = {
|
||||||
x: handRotation.z,
|
x: -handRotation.x,
|
||||||
y: handRotation.y,
|
y: -handRotation.z,
|
||||||
z: handRotation.x,
|
z: -handRotation.y,
|
||||||
w: handRotation.w
|
w: handRotation.w,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Hand rotation in avatar coordinates ...
|
// Hand rotation in avatar coordinates ...
|
||||||
if (h === 0) {
|
handRotation = Quat.multiply(Quat.angleAxis(180.0, { x: 0, y: 1, z: 0 }), handRotation);
|
||||||
handRotation.x = -handRotation.x;
|
|
||||||
handRotation = Quat.multiply(Quat.angleAxis(90.0, { x: 1, y: 0, z: 0 }), handRotation);
|
|
||||||
handRotation = Quat.multiply(Quat.angleAxis(90.0, { x: 0, y: 0, z: 1 }), handRotation);
|
|
||||||
} else {
|
|
||||||
handRotation.z = -handRotation.z;
|
|
||||||
handRotation = Quat.multiply(Quat.angleAxis(90.0, { x: 1, y: 0, z: 0 }), handRotation);
|
|
||||||
handRotation = Quat.multiply(Quat.angleAxis(-90.0, { x: 0, y: 0, z: 1 }), handRotation);
|
|
||||||
}
|
|
||||||
|
|
||||||
cameraOrientation.x = -cameraOrientation.x;
|
cameraOrientation.x = -cameraOrientation.x;
|
||||||
cameraOrientation.z = -cameraOrientation.z;
|
cameraOrientation.z = -cameraOrientation.z;
|
||||||
handRotation = Quat.multiply(cameraOrientation, handRotation);
|
handRotation = Quat.multiply(cameraOrientation, handRotation);
|
||||||
|
|
Loading…
Reference in a new issue