mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-15 10:17:40 +02:00
Merge pull request #4170 from Atlante45/hydra_grab_fix
Fixed mapped rotation + doubled it
This commit is contained in:
commit
2108cac38e
1 changed files with 6 additions and 5 deletions
|
@ -108,7 +108,7 @@ function controller(wichSide) {
|
|||
this.positionAtGrab;
|
||||
this.rotationAtGrab;
|
||||
this.modelPositionAtGrab;
|
||||
this.rotationAtGrab;
|
||||
this.modelRotationAtGrab;
|
||||
this.jointsIntersectingFromStart = [];
|
||||
|
||||
this.laser = Overlays.addOverlay("line3d", {
|
||||
|
@ -165,7 +165,7 @@ function controller(wichSide) {
|
|||
this.positionAtGrab = this.palmPosition;
|
||||
this.rotationAtGrab = this.rotation;
|
||||
this.modelPositionAtGrab = properties.position;
|
||||
this.rotationAtGrab = properties.rotation;
|
||||
this.modelRotationAtGrab = properties.rotation;
|
||||
this.jointsIntersectingFromStart = [];
|
||||
for (var i = 0; i < jointList.length; i++) {
|
||||
var distance = Vec3.distance(MyAvatar.getJointPosition(jointList[i]), this.oldModelPosition);
|
||||
|
@ -381,8 +381,9 @@ function controller(wichSide) {
|
|||
|
||||
newRotation = Quat.multiply(this.rotation,
|
||||
Quat.inverse(this.rotationAtGrab));
|
||||
newRotation = Quat.multiply(newRotation, newRotation);
|
||||
newRotation = Quat.multiply(newRotation,
|
||||
this.rotationAtGrab);
|
||||
this.modelRotationAtGrab);
|
||||
break;
|
||||
}
|
||||
Entities.editEntity(this.entityID, {
|
||||
|
@ -595,11 +596,11 @@ function moveEntities() {
|
|||
leftController.positionAtGrab = leftController.palmPosition;
|
||||
leftController.rotationAtGrab = leftController.rotation;
|
||||
leftController.modelPositionAtGrab = leftController.oldModelPosition;
|
||||
leftController.rotationAtGrab = rotation;
|
||||
leftController.modelRotationAtGrab = rotation;
|
||||
rightController.positionAtGrab = rightController.palmPosition;
|
||||
rightController.rotationAtGrab = rightController.rotation;
|
||||
rightController.modelPositionAtGrab = rightController.oldModelPosition;
|
||||
rightController.rotationAtGrab = rotation;
|
||||
rightController.modelRotationAtGrab = rotation;
|
||||
break;
|
||||
}
|
||||
Entities.editEntity(leftController.entityID, {
|
||||
|
|
Loading…
Reference in a new issue