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

Method renderCubicTo

src/main/java/field/graphics/FLine.java:1409–1433  ·  view source on GitHub ↗
(int fixedSize)

Source from the content-addressed store, hash-verified

1407 for (int i = 0; i < fixedSize; i++) {
1408 float alpha = (i + 1f) / fixedSize;
1409 o = evaluateCubicFrame(from.to.x, from.to.y, from.to.z, to.c1.x, to.c1.y, to.c1.z, to.c2.x, to.c2.y,
1410 to.c2.z, to.to.x, to.to.y, to.to.z, alpha, o);
1411
1412 if (from.flatAuxData != null) for (int j = 0; j < from.flatAuxData.length; j++) {
1413 int channel = from.flatAux[j];
1414 float[] a = from.flatAuxData[j];
1415 float[] b = to.flatAuxData[j];
1416 if (a == null && b == null) continue;
1417 float[] r = interpolate(alpha, a, b, a == null ? b.length : a.length);
1418 if (r != null && channel > 0) meshBuilder.aux(channel, r);
1419 }
1420
1421 meshBuilder.v(o.x, o.y, o.z);
1422 }
1423 return to;
1424 };
1425
1426 }
1427
1428 /**
1429 * make a new line by transforming all of the positions of this line by a function.
1430 * <p>
1431 * For example `someLine.byTransforming( (p) => p + vec(10,0) )` will yield a line 10 units to the right of `someLine` (of course `someLine + vec(10,0)` does the same). You might need a
1432 * little more JavaScript syntax than usual here: `someLine.byTransforming( function(x) { ... return something ... } )` and `someLine.byTransforming( (x)=> { ... return something ... } ) `
1433 * are both valid.
1434 */
1435 public FLine byTransforming(Function<Vec3, Vec3> spaceTransform) {
1436

Callers 3

renderToPointsMethod · 0.95
renderToLineMethod · 0.95
renderToMeshMethod · 0.95

Calls 4

evaluateCubicFrameMethod · 0.95
interpolateMethod · 0.95
auxMethod · 0.65
vMethod · 0.65

Tested by

no test coverage detected