MCPcopy Create free account
hub / github.com/dailydotdev/apps / hexKey

Function hexKey

packages/webapp/components/world/engine/world.js:7084–7084  ·  view source on GitHub ↗
(q,r)

Source from the content-addressed store, hash-verified

7082const DIRS=[[1,0],[0,1],[-1,1],[-1,0],[0,-1],[1,-1]]; // ordered by bearing
7083const hexXZ=(q,r)=>[1.5*HC*q, Math.sqrt(3)*HC*(r+q/2)];
7084const hexKey=(q,r)=>q+','+r;
7085const hexCorner=k=>[Math.cos(k*Math.PI/3)*HC, Math.sin(k*Math.PI/3)*HC];
7086/* World point -> the cell that contains it. Cube rounding, the standard trick;
7087 this is the whole of the picking system — no raycast, no colliders. */

Callers 5

ownershipFunction · 0.85
buildLandFunction · 0.85
pickFunction · 0.85
handTargetAtFunction · 0.85
handReleaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected