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

Method build3d

src/main/java/marc/math/Flann.java:111–126  ·  view source on GitHub ↗
(List<T> d, Function<T, Vec3> t)

Source from the content-addressed store, hash-verified

109 }
110
111 public <T> void build3d(List<T> d, Function<T, Vec3> t) {
112 free();
113
114 FloatBuffer f = (allocated == null || allocated.capacity() != d.size() * 3) ? ByteBuffer.allocateDirect(
115 4 * d.size() * 3)
116 .order(ByteOrder.nativeOrder())
117 .asFloatBuffer() : allocated;
118 for (T dd : d) {
119 Vec3 v = t.apply(dd);
120 f.put((float) v.x).put((float) v.y).put((float) v.z);
121 }
122 f.rewind();
123 cloud = build3(f, d.size());
124 allocated = f;
125 is2d = false;
126 }
127
128 public <T> void build128d(List<T> d, Function<T, float[]> t) {
129 free();

Callers 2

showKnnMethod · 0.80
PointCloudFlannClass · 0.80

Calls 6

freeMethod · 0.95
build3Method · 0.95
applyMethod · 0.65
sizeMethod · 0.45
orderMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected