(poly)
| 426 | // Sets `depth` property of given `poly`. |
| 427 | // Also triggers midpoint calculation, which mutates `middle` property of `poly`. |
| 428 | function computePolyDepth(poly) { |
| 429 | computePolyMiddle(poly); |
| 430 | const dX = poly.middle.x; |
| 431 | const dY = poly.middle.y; |
| 432 | const dZ = poly.middle.z - cameraDistance; |
| 433 | poly.depth = Math.hypot(dX, dY, dZ); |
| 434 | } |
| 435 | |
| 436 | // Compute normal of any polygon. Uses normalized vector cross product. |
| 437 | // Mutates `normalName` property of given `poly`. |
nothing calls this directly
no test coverage detected