Merge pull request #6761 from imgntn/grab_add_beam

Add Beam Visualization When Grab Doesn't Intersect
This commit is contained in:
Eric Levin 2016-01-04 15:36:05 -08:00
commit f569d08ca8

View file

@ -430,7 +430,12 @@ function MyController(hand) {
}
this.searchSphere = Overlays.addOverlay("sphere", sphereProperties);
} else {
Overlays.editOverlay(this.searchSphere, { position: location, size: size, color: color, visible: true });
Overlays.editOverlay(this.searchSphere, {
position: location,
size: size,
color: color,
visible: true
});
}
}
@ -795,6 +800,12 @@ function MyController(hand) {
length: PICK_MAX_DISTANCE
};
var searchVisualizationPickRay = {
origin: handPosition,
direction: Quat.getUp(this.getHandRotation()),
length: PICK_MAX_DISTANCE
};
// Pick at some maximum rate, not always
var pickRays = [];
var now = Date.now();
@ -1015,6 +1026,11 @@ function MyController(hand) {
if (USE_PARTICLE_BEAM_FOR_SEARCHING === true) {
this.handleParticleBeam(distantPickRay.origin, this.getHandRotation(), NO_INTERSECT_COLOR);
}
if (USE_OVERLAY_LINES_FOR_SEARCHING === true) {
this.overlayLineOn(searchVisualizationPickRay.origin, Vec3.sum(searchVisualizationPickRay.origin, Vec3.multiply(searchVisualizationPickRay.direction, LINE_LENGTH)), NO_INTERSECT_COLOR);
}
if (this.intersectionDistance > 0) {
var SPHERE_INTERSECTION_SIZE = 0.011;
var SEARCH_SPHERE_FOLLOW_RATE = 0.50;