MCPcopy Index your code
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / getFragForTarget

Function getFragForTarget

assets/js/block_ninja.js:1052–1065  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

1050 const fragCount = basePositions.length;
1051
1052 function getFragForTarget(target) {
1053 const pool = target.wireframe ? fragWireframePool : fragPool;
1054 let frag = pool.get(target.color).pop();
1055 if (!frag) {
1056 frag = new Entity({
1057 model: makeCubeModel({ scale: fragRadius }),
1058 color: target.color,
1059 wireframe: target.wireframe
1060 });
1061 frag.color = target.color;
1062 frag.wireframe = target.wireframe;
1063 }
1064 return frag;
1065 }
1066
1067 return (target, force=1) => {
1068 // Calculate fragment positions, and what would have been the previous positions

Callers 1

block_ninja.jsFile · 0.85

Calls 1

makeCubeModelFunction · 0.85

Tested by

no test coverage detected