in src/geo/ViewportCoords.ts [256:296]
public getBasicDistances(
transform: Transform,
camera: THREE.Camera):
number[] {
const topLeftBasic: number[] = this.viewportToBasic(-1, 1, transform, camera);
const topRightBasic: number[] = this.viewportToBasic(1, 1, transform, camera);
const bottomRightBasic: number[] = this.viewportToBasic(1, -1, transform, camera);
const bottomLeftBasic: number[] = this.viewportToBasic(-1, -1, transform, camera);
let topBasicDistance: number = 0;
let rightBasicDistance: number = 0;
let bottomBasicDistance: number = 0;
let leftBasicDistance: number = 0;
if (topLeftBasic[1] < 0 && topRightBasic[1] < 0) {
topBasicDistance = topLeftBasic[1] > topRightBasic[1] ?
-topLeftBasic[1] :
-topRightBasic[1];
}
if (topRightBasic[0] > 1 && bottomRightBasic[0] > 1) {
rightBasicDistance = topRightBasic[0] < bottomRightBasic[0] ?
topRightBasic[0] - 1 :
bottomRightBasic[0] - 1;
}
if (bottomRightBasic[1] > 1 && bottomLeftBasic[1] > 1) {
bottomBasicDistance = bottomRightBasic[1] < bottomLeftBasic[1] ?
bottomRightBasic[1] - 1 :
bottomLeftBasic[1] - 1;
}
if (bottomLeftBasic[0] < 0 && topLeftBasic[0] < 0) {
leftBasicDistance = bottomLeftBasic[0] > topLeftBasic[0] ?
-bottomLeftBasic[0] :
-topLeftBasic[0];
}
return [topBasicDistance, rightBasicDistance, bottomBasicDistance, leftBasicDistance];
}