mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 14:42:03 +02:00
Add head-to-hand mixing ratio, default to zero (hands only)
This commit is contained in:
parent
c18a2fc264
commit
f4389c3b1f
1 changed files with 4 additions and 5 deletions
|
@ -30,6 +30,8 @@ var TRIGGER_OFF_VALUE = 0.15;
|
||||||
|
|
||||||
var BUMPER_ON_VALUE = 0.5;
|
var BUMPER_ON_VALUE = 0.5;
|
||||||
|
|
||||||
|
var HAND_HEAD_MIX_RATIO = 0.0; // 0 = only use hands for search/move. 1 = only use head for search/move.
|
||||||
|
|
||||||
//
|
//
|
||||||
// distant manipulation
|
// distant manipulation
|
||||||
//
|
//
|
||||||
|
@ -790,7 +792,7 @@ function MyController(hand) {
|
||||||
var distantPickRay = {
|
var distantPickRay = {
|
||||||
origin: Camera.position,
|
origin: Camera.position,
|
||||||
//direction: Quat.getFront(Quat.multiply(Camera.orientation, handDeltaRotation)),
|
//direction: Quat.getFront(Quat.multiply(Camera.orientation, handDeltaRotation)),
|
||||||
direction: Vec3.mix(Quat.getUp(this.getHandRotation()), Quat.getFront(Camera.orientation), 0.5),
|
direction: Vec3.mix(Quat.getUp(this.getHandRotation()), Quat.getFront(Camera.orientation), HAND_HEAD_MIX_RATIO),
|
||||||
length: PICK_MAX_DISTANCE
|
length: PICK_MAX_DISTANCE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1188,15 +1190,12 @@ function MyController(hand) {
|
||||||
y: 0.0,
|
y: 0.0,
|
||||||
z: objDistance
|
z: objDistance
|
||||||
});
|
});
|
||||||
var change = Vec3.subtract(before, after);
|
var change = Vec3.multiply(Vec3.subtract(before, after), HAND_HEAD_MIX_RATIO);
|
||||||
this.currentCameraOrientation = Camera.orientation;
|
this.currentCameraOrientation = Camera.orientation;
|
||||||
this.currentObjectPosition = Vec3.sum(this.currentObjectPosition, change);
|
this.currentObjectPosition = Vec3.sum(this.currentObjectPosition, change);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// print('should not head move!');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var defaultConstraintData = {
|
var defaultConstraintData = {
|
||||||
axisStart: false,
|
axisStart: false,
|
||||||
axisEnd: false,
|
axisEnd: false,
|
||||||
|
|
Loading…
Reference in a new issue