MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / computePolyDepth

Function computePolyDepth

assets/js/block_ninja.js:428–434  ·  view source on GitHub ↗
(poly)

Source from the content-addressed store, hash-verified

426// Sets `depth` property of given `poly`.
427// Also triggers midpoint calculation, which mutates `middle` property of `poly`.
428function 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`.

Callers

nothing calls this directly

Calls 1

computePolyMiddleFunction · 0.85

Tested by

no test coverage detected