mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 16:55:06 +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));
|
||||
if (pose.valid) {
|
||||
if (!this.manipulating) {
|
||||
//this.initialEntityRotation = Quat.multiply(this.getTargetRotation(), Quat.inverse(MyAvatar.orientation)); // Avatar frame.
|
||||
this.initialEntityRotation = this.getTargetRotation(); // Worldframe.
|
||||
this.initialControllerRotation = Quat.multiply(MyAvatar.orientation, pose.rotation); // Worldframe.
|
||||
//this.initialEntityRotation = Quat.multiply(this.getTargetRotation(), Quat.inverse(MyAvatar.orientation));
|
||||
this.initialControllerRotation = Quat.multiply(pose.rotation, MyAvatar.orientation); // Worldframe.
|
||||
this.manipulating = true;
|
||||
}
|
||||
}
|
||||
|
||||
var rot = Quat.multiply(MyAvatar.orientation, pose.rotation);
|
||||
var rot = Quat.multiply(pose.rotation, MyAvatar.orientation);
|
||||
var rotBetween = this.calculateEntityRotationManipulation(rot);
|
||||
this.setJointRotation(Quat.multiply(rotBetween, this.initialEntityRotation));
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue