mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 07:09:54 +02:00
Merge pull request #6761 from imgntn/grab_add_beam
Add Beam Visualization When Grab Doesn't Intersect
This commit is contained in:
commit
f569d08ca8
1 changed files with 27 additions and 11 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue