mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 03:17:08 +02:00
Merge pull request #6754 from PhilipRosedale/master
Show hand-sphere search line and point just with hand direction again
This commit is contained in:
commit
60bc023d6e
1 changed files with 5 additions and 8 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
|
||||||
//
|
//
|
||||||
|
@ -789,7 +791,7 @@ function MyController(hand) {
|
||||||
|
|
||||||
var distantPickRay = {
|
var distantPickRay = {
|
||||||
origin: Camera.position,
|
origin: Camera.position,
|
||||||
direction: Quat.getFront(Quat.multiply(Camera.orientation, handDeltaRotation)),
|
direction: Vec3.mix(Quat.getUp(this.getHandRotation()), Quat.getFront(Camera.orientation), HAND_HEAD_MIX_RATIO),
|
||||||
length: PICK_MAX_DISTANCE
|
length: PICK_MAX_DISTANCE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1022,9 +1024,7 @@ function MyController(hand) {
|
||||||
searchSphereLocation.y -= ((this.intersectionDistance - this.searchSphereDistance) / this.intersectionDistance) * SEARCH_SPHERE_CHASE_DROP;
|
searchSphereLocation.y -= ((this.intersectionDistance - this.searchSphereDistance) / this.intersectionDistance) * SEARCH_SPHERE_CHASE_DROP;
|
||||||
this.searchSphereOn(searchSphereLocation, SPHERE_INTERSECTION_SIZE * this.intersectionDistance, this.triggerSmoothedGrab() ? INTERSECT_COLOR : NO_INTERSECT_COLOR);
|
this.searchSphereOn(searchSphereLocation, SPHERE_INTERSECTION_SIZE * this.intersectionDistance, this.triggerSmoothedGrab() ? INTERSECT_COLOR : NO_INTERSECT_COLOR);
|
||||||
if (USE_OVERLAY_LINES_FOR_SEARCHING === true) {
|
if (USE_OVERLAY_LINES_FOR_SEARCHING === true) {
|
||||||
var OVERLAY_BEAM_SETBACK = 0.9;
|
this.overlayLineOn(handPosition, searchSphereLocation, this.triggerSmoothedGrab() ? INTERSECT_COLOR : NO_INTERSECT_COLOR);
|
||||||
var startBeam = Vec3.sum(handPosition, Vec3.multiply(Vec3.subtract(searchSphereLocation, handPosition), OVERLAY_BEAM_SETBACK));
|
|
||||||
this.overlayLineOn(startBeam, searchSphereLocation, this.triggerSmoothedGrab() ? INTERSECT_COLOR : NO_INTERSECT_COLOR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1189,15 +1189,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