mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 16:41:02 +02:00
terminate lines at intersection
This commit is contained in:
parent
dc8e21d76c
commit
696169ed37
1 changed files with 22 additions and 11 deletions
|
@ -256,16 +256,15 @@ function Teleporter() {
|
||||||
|
|
||||||
var location = Vec3.sum(rightPickRay.origin, Vec3.multiply(rightPickRay.direction, 500));
|
var location = Vec3.sum(rightPickRay.origin, Vec3.multiply(rightPickRay.direction, 500));
|
||||||
|
|
||||||
this.rightLineOn(rightPickRay.origin, location, {
|
|
||||||
red: 7,
|
|
||||||
green: 36,
|
|
||||||
blue: 44
|
|
||||||
});
|
|
||||||
|
|
||||||
var rightIntersection = Entities.findRayIntersection(teleporter.rightPickRay, true, [], [this.targetEntity]);
|
var rightIntersection = Entities.findRayIntersection(teleporter.rightPickRay, true, [], [this.targetEntity]);
|
||||||
|
|
||||||
if (rightIntersection.intersects) {
|
if (rightIntersection.intersects) {
|
||||||
|
this.rightLineOn(rightPickRay.origin, rightIntersection.intersection, {
|
||||||
|
red: 7,
|
||||||
|
green: 36,
|
||||||
|
blue: 44
|
||||||
|
});
|
||||||
if (this.targetOverlay !== null) {
|
if (this.targetOverlay !== null) {
|
||||||
this.updateTargetOverlay(rightIntersection);
|
this.updateTargetOverlay(rightIntersection);
|
||||||
} else {
|
} else {
|
||||||
|
@ -273,6 +272,12 @@ function Teleporter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
this.rightLineOn(rightPickRay.origin, location, {
|
||||||
|
red: 7,
|
||||||
|
green: 36,
|
||||||
|
blue: 44
|
||||||
|
});
|
||||||
this.deleteTargetOverlay();
|
this.deleteTargetOverlay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,16 +305,16 @@ function Teleporter() {
|
||||||
|
|
||||||
var location = Vec3.sum(MyAvatar.position, Vec3.multiply(leftPickRay.direction, 500));
|
var location = Vec3.sum(MyAvatar.position, Vec3.multiply(leftPickRay.direction, 500));
|
||||||
|
|
||||||
this.leftLineOn(leftPickRay.origin, location, {
|
|
||||||
red: 7,
|
|
||||||
green: 36,
|
|
||||||
blue: 44
|
|
||||||
});
|
|
||||||
|
|
||||||
var leftIntersection = Entities.findRayIntersection(teleporter.leftPickRay, true, [], [this.targetEntity]);
|
var leftIntersection = Entities.findRayIntersection(teleporter.leftPickRay, true, [], [this.targetEntity]);
|
||||||
|
|
||||||
if (leftIntersection.intersects) {
|
if (leftIntersection.intersects) {
|
||||||
|
|
||||||
|
this.leftLineOn(leftPickRay.origin, leftIntersection.intersection, {
|
||||||
|
red: 7,
|
||||||
|
green: 36,
|
||||||
|
blue: 44
|
||||||
|
});
|
||||||
if (this.targetOverlay !== null) {
|
if (this.targetOverlay !== null) {
|
||||||
this.updateTargetOverlay(leftIntersection);
|
this.updateTargetOverlay(leftIntersection);
|
||||||
} else {
|
} else {
|
||||||
|
@ -318,6 +323,12 @@ function Teleporter() {
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
this.leftLineOn(leftPickRay.origin, location, {
|
||||||
|
red: 7,
|
||||||
|
green: 36,
|
||||||
|
blue: 44
|
||||||
|
});
|
||||||
this.deleteTargetOverlay();
|
this.deleteTargetOverlay();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue