Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected shouldSplitTriangle(a: Vector3, b: Vector3, c: Vector3): number | undefined {
const aa = sphereProjection.reprojectPoint(this.projection, a, VERTEX_POSITION_CACHE[0]);
const bb = sphereProjection.reprojectPoint(this.projection, b, VERTEX_POSITION_CACHE[1]);
const cc = sphereProjection.reprojectPoint(this.projection, c, VERTEX_POSITION_CACHE[2]);
const alpha = aa.angleTo(bb);
const beta = bb.angleTo(cc);
const gamma = cc.angleTo(aa);
// find the maximum angle
const m = Math.max(alpha, Math.max(beta, gamma));
// split the triangle if needed.
if (m < this.angle) {
return undefined;
}
if (m === alpha) {
return 0;
protected shouldSplitTriangle(a: Vector3, b: Vector3, c: Vector3): number | undefined {
const aa = sphereProjection.reprojectPoint(this.projection, a, VERTEX_POSITION_CACHE[0]);
const bb = sphereProjection.reprojectPoint(this.projection, b, VERTEX_POSITION_CACHE[1]);
const cc = sphereProjection.reprojectPoint(this.projection, c, VERTEX_POSITION_CACHE[2]);
const alpha = aa.angleTo(bb);
const beta = bb.angleTo(cc);
const gamma = cc.angleTo(aa);
// find the maximum angle
const m = Math.max(alpha, Math.max(beta, gamma));
// split the triangle if needed.
if (m < this.angle) {
return undefined;
}
if (m === alpha) {
return 0;
} else if (m === beta) {
protected shouldSplitTriangle(a: Vector3, b: Vector3, c: Vector3): number | undefined {
const aa = sphereProjection.reprojectPoint(this.projection, a, VERTEX_POSITION_CACHE[0]);
const bb = sphereProjection.reprojectPoint(this.projection, b, VERTEX_POSITION_CACHE[1]);
const cc = sphereProjection.reprojectPoint(this.projection, c, VERTEX_POSITION_CACHE[2]);
const alpha = aa.angleTo(bb);
const beta = bb.angleTo(cc);
const gamma = cc.angleTo(aa);
// find the maximum angle
const m = Math.max(alpha, Math.max(beta, gamma));
// split the triangle if needed.
if (m < this.angle) {
return undefined;
}
if (m === alpha) {