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

Function hexKey

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

Source from the content-addressed store, hash-verified

6880const DIRS=[[1,0],[0,1],[-1,1],[-1,0],[0,-1],[1,-1]]; // ordered by bearing
6881const hexXZ=(q,r)=>[1.5*HC*q, Math.sqrt(3)*HC*(r+q/2)];
6882const hexKey=(q,r)=>q+','+r;
6883const hexCorner=k=>[Math.cos(k*Math.PI/3)*HC, Math.sin(k*Math.PI/3)*HC];
6884/* World point -> the cell that contains it. Cube rounding, the standard trick;
6885 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