use new-style hand-lasers for both hands

This commit is contained in:
Seth Alves 2017-03-02 10:01:08 -08:00
parent 7f6b803652
commit 93055a67a8

View file

@ -1001,53 +1001,30 @@ function MyController(hand) {
this.overlayLineOn = function(closePoint, farPoint, color, farParentID) { this.overlayLineOn = function(closePoint, farPoint, color, farParentID) {
if (this.overlayLine === null) { if (this.overlayLine === null) {
var lineProperties; var lineProperties = {
if (this.hand === RIGHT_HAND) { glow: 1.0,
lineProperties = { lineWidth: 5,
glow: 1.0, start: closePoint,
lineWidth: 5, end: farPoint,
start: closePoint, color: color,
end: farPoint, ignoreRayIntersection: true, // always ignore this
color: color, drawInFront: true, // Even when burried inside of something, show it.
ignoreRayIntersection: true, // always ignore this visible: true,
drawInFront: true, // Even when burried inside of something, show it. alpha: 1,
visible: true, parentID: AVATAR_SELF_ID,
alpha: 1, parentJointIndex: this.controllerJointIndex,
parentID: AVATAR_SELF_ID, endParentID: farParentID
parentJointIndex: this.controllerJointIndex, };
endParentID: farParentID
};
} else {
lineProperties = {
glow: 1.0,
lineWidth: 5,
start: closePoint,
end: farPoint,
color: color,
ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it.
visible: true,
alpha: 1,
};
}
this.overlayLine = Overlays.addOverlay("line3d", lineProperties); this.overlayLine = Overlays.addOverlay("line3d", lineProperties);
} else { } else {
if (this.hand === RIGHT_HAND) { if (farParentID && farParentID != NULL_UUID) {
if (farParentID && farParentID != NULL_UUID) { Overlays.editOverlay(this.overlayLine, {
Overlays.editOverlay(this.overlayLine, { color: color,
color: color, });
});
} else {
Overlays.editOverlay(this.overlayLine, {
length: Vec3.distance(farPoint, closePoint),
color: color,
});
}
} else { } else {
Overlays.editOverlay(this.overlayLine, { Overlays.editOverlay(this.overlayLine, {
start: closePoint, length: Vec3.distance(farPoint, closePoint),
end: farPoint,
color: color, color: color,
}); });
} }