mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-10 21:38:42 +02:00
lazers
This commit is contained in:
parent
8b7cfde02a
commit
1ba6bfa2e0
1 changed files with 28 additions and 0 deletions
|
@ -318,6 +318,34 @@ function MyController(hand) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.overlayLineOn = function(color) {
|
||||||
|
|
||||||
|
var handPosition = this.getHandPosition();
|
||||||
|
var distantPickRay = {
|
||||||
|
origin: handPosition,
|
||||||
|
direction: Quat.getUp(this.getHandRotation()),
|
||||||
|
length: PICK_MAX_DISTANCE
|
||||||
|
};
|
||||||
|
|
||||||
|
var end = Vec3.Sum(handPosition, Vec3.multiply(distantPickRay.direction, NEAR_PICK_MAX_DISTANCE));
|
||||||
|
|
||||||
|
var lineProperties = {
|
||||||
|
lineWidth: 5,
|
||||||
|
//get palm position
|
||||||
|
start: distantPickRay.origin,
|
||||||
|
end: end,
|
||||||
|
color: color || {
|
||||||
|
red: 255,
|
||||||
|
green: 0,
|
||||||
|
blue: 255
|
||||||
|
},
|
||||||
|
ignoreRayIntersection: true, // always ignore this
|
||||||
|
visible: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
this.pointerOverlay = Overlays.addOverlay("line3d", lineProperties);
|
||||||
|
}
|
||||||
|
|
||||||
this.lineOn = function(closePoint, farPoint, color) {
|
this.lineOn = function(closePoint, farPoint, color) {
|
||||||
// draw a line
|
// draw a line
|
||||||
if (this.pointer === null) {
|
if (this.pointer === null) {
|
||||||
|
|
Loading…
Reference in a new issue