From 0d4ac4387aa8c3e3e309eebb9c2e2ec48c30dada Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Thu, 31 Dec 2015 11:46:35 -0800 Subject: [PATCH 1/4] Show hand-sphere search line and point just with hand direction again --- examples/controllers/handControllerGrab.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 8af8731c8d..e747bb0897 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -789,7 +789,8 @@ function MyController(hand) { var distantPickRay = { origin: Camera.position, - direction: Quat.getFront(Quat.multiply(Camera.orientation, handDeltaRotation)), + //direction: Quat.getFront(Quat.multiply(Camera.orientation, handDeltaRotation)), + direction: Quat.getUp(this.getHandRotation()), length: PICK_MAX_DISTANCE }; @@ -1022,9 +1023,7 @@ function MyController(hand) { 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); if (USE_OVERLAY_LINES_FOR_SEARCHING === true) { - var OVERLAY_BEAM_SETBACK = 0.9; - 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); + this.overlayLineOn(handPosition, searchSphereLocation, this.triggerSmoothedGrab() ? INTERSECT_COLOR : NO_INTERSECT_COLOR); } } }; From c18a2fc2645b9c6ed2619a839c9b483093e183c5 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Thu, 31 Dec 2015 11:56:37 -0800 Subject: [PATCH 2/4] blend 50/50 between head and hands for search --- examples/controllers/handControllerGrab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index e747bb0897..df36366326 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -790,7 +790,7 @@ function MyController(hand) { var distantPickRay = { origin: Camera.position, //direction: Quat.getFront(Quat.multiply(Camera.orientation, handDeltaRotation)), - direction: Quat.getUp(this.getHandRotation()), + direction: Vec3.mix(Quat.getUp(this.getHandRotation()), Quat.getFront(Camera.orientation), 0.5), length: PICK_MAX_DISTANCE }; From f4389c3b1fc3d060b3c222c1177f4b7514174349 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Thu, 31 Dec 2015 13:36:24 -0800 Subject: [PATCH 3/4] Add head-to-hand mixing ratio, default to zero (hands only) --- examples/controllers/handControllerGrab.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index df36366326..1dfc0ffacd 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -30,6 +30,8 @@ var TRIGGER_OFF_VALUE = 0.15; 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 // @@ -790,7 +792,7 @@ function MyController(hand) { var distantPickRay = { origin: Camera.position, //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 }; @@ -1188,15 +1190,12 @@ function MyController(hand) { y: 0.0, 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.currentObjectPosition = Vec3.sum(this.currentObjectPosition, change); } - } else { - // print('should not head move!'); } - var defaultConstraintData = { axisStart: false, axisEnd: false, From 85a0dfa21a042f67aae7683472f075c8675d737c Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Thu, 31 Dec 2015 13:49:24 -0800 Subject: [PATCH 4/4] remove debug line --- examples/controllers/handControllerGrab.js | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 1dfc0ffacd..ed02bd3709 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -791,7 +791,6 @@ function MyController(hand) { var distantPickRay = { 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 };