mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-02 11:00:21 +02:00
Fix frame of reference for rotations.
This commit is contained in:
parent
2a04d2b9c5
commit
f3b65d06ad
1 changed files with 2 additions and 4 deletions
|
@ -242,15 +242,13 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
var pose = Controller.getPoseValue((this.getDominantHand() ? Controller.Standard.RightHand : Controller.Standard.LeftHand));
|
var pose = Controller.getPoseValue((this.getDominantHand() ? Controller.Standard.RightHand : Controller.Standard.LeftHand));
|
||||||
if (pose.valid) {
|
if (pose.valid) {
|
||||||
if (!this.manipulating) {
|
if (!this.manipulating) {
|
||||||
//this.initialEntityRotation = Quat.multiply(this.getTargetRotation(), Quat.inverse(MyAvatar.orientation)); // Avatar frame.
|
|
||||||
this.initialEntityRotation = this.getTargetRotation(); // Worldframe.
|
this.initialEntityRotation = this.getTargetRotation(); // Worldframe.
|
||||||
this.initialControllerRotation = Quat.multiply(MyAvatar.orientation, pose.rotation); // Worldframe.
|
this.initialControllerRotation = Quat.multiply(pose.rotation, MyAvatar.orientation); // Worldframe.
|
||||||
//this.initialEntityRotation = Quat.multiply(this.getTargetRotation(), Quat.inverse(MyAvatar.orientation));
|
|
||||||
this.manipulating = true;
|
this.manipulating = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var rot = Quat.multiply(MyAvatar.orientation, pose.rotation);
|
var rot = Quat.multiply(pose.rotation, MyAvatar.orientation);
|
||||||
var rotBetween = this.calculateEntityRotationManipulation(rot);
|
var rotBetween = this.calculateEntityRotationManipulation(rot);
|
||||||
this.setJointRotation(Quat.multiply(rotBetween, this.initialEntityRotation));
|
this.setJointRotation(Quat.multiply(rotBetween, this.initialEntityRotation));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue