Fix walk.js script

This commit is contained in:
Thijs Wenker 2015-10-12 19:03:34 +02:00
parent 309b381bab
commit a6da91ee35
2 changed files with 6 additions and 6 deletions

View file

@ -82,7 +82,7 @@ Avatar = function() {
// only need to zero right leg IK chain and hips
if (IKChain === "RightLeg" || joint === "Hips" ) {
MyAvatar.setJointData(joint, Quat.fromPitchYawRollDegrees(0, 0, 0));
MyAvatar.setJointRotation(MyAvatar.jointNames.indexOf(joint), Quat.fromPitchYawRollDegrees(0, 0, 0));
}
}
this.calibration.hipsToFeet = MyAvatar.getJointPosition("Hips").y - MyAvatar.getJointPosition("RightToeBase").y;
@ -112,16 +112,16 @@ Avatar = function() {
this.poseFingers = function() {
for (knuckle in walkAssets.animationReference.leftHand) {
if (walkAssets.animationReference.leftHand[knuckle].IKChain === "LeftHandThumb") {
MyAvatar.setJointData(knuckle, Quat.fromPitchYawRollDegrees(0, 0, -4));
MyAvatar.setJointRotation(MyAvatar.jointNames.indexOf(knuckle), Quat.fromPitchYawRollDegrees(0, 0, -4));
} else {
MyAvatar.setJointData(knuckle, Quat.fromPitchYawRollDegrees(16, 0, 5));
MyAvatar.setJointRotation(MyAvatar.jointNames.indexOf(knuckle), Quat.fromPitchYawRollDegrees(16, 0, 5));
}
}
for (knuckle in walkAssets.animationReference.rightHand) {
if (walkAssets.animationReference.rightHand[knuckle].IKChain === "RightHandThumb") {
MyAvatar.setJointData(knuckle, Quat.fromPitchYawRollDegrees(0, 0, 4));
MyAvatar.setJointRotation(MyAvatar.jointNames.indexOf(knuckle), Quat.fromPitchYawRollDegrees(0, 0, 4));
} else {
MyAvatar.setJointData(knuckle, Quat.fromPitchYawRollDegrees(16, 0, -5));
MyAvatar.setJointRotation(MyAvatar.jointNames.indexOf(knuckle), Quat.fromPitchYawRollDegrees(16, 0, -5));
}
}
};

View file

@ -449,6 +449,6 @@ function renderMotion() {
}
// apply rotations
MyAvatar.setJointData(jointName, Quat.fromVec3Degrees(jointRotations));
MyAvatar.setJointRotation(MyAvatar.jointNames.indexOf(jointName), Quat.fromVec3Degrees(jointRotations));
}
}