MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / find2

Method find2

src/main/java/marc/math/Flann.java:219–233  ·  view source on GitHub ↗
(Vec2 p, int n)

Source from the content-addressed store, hash-verified

217 }
218
219 public List<Integer> find2(Vec2 p, int n) {
220 if (cache == null || cache.capacity() < n) {
221 cache = ByteBuffer.allocateDirect(8 * n).order(ByteOrder.nativeOrder()).asLongBuffer();
222 }
223 cache.rewind();
224 if (cloud == -1 || !is2d) throw new IllegalArgumentException();
225
226 closestN2(cloud, (float) p.x, (float) p.y, cache, n);
227
228 List<Integer> r = new ArrayList<Integer>();
229 for (int i = 0; i < n; i++) {
230 r.add((int) cache.get(i));
231 }
232 return r;
233 }
234
235 public int find3(Vec3 p) {
236

Callers

nothing calls this directly

Calls 5

closestN2Method · 0.95
closest2Method · 0.95
getMethod · 0.65
orderMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected