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

Method cursorFromClosestPoint

src/main/java/field/graphics/FLine.java:1397–1400  ·  view source on GitHub ↗

returns a cursor that is at the position on this line that is as close to `point` as possible

(Vec3 point)

Source from the content-addressed store, hash-verified

1395 /*
1396 * Everybody is taught in the textbooks that the way to draw a cubic spline segment is to recursively subdivide it until the sub-segments are flat enough that you can just draw them with
1397 * straight lines. This is a great, efficient and beautiful idea. However, it suffers from a serious problem in the case where the geometry you are drawing is animated: the number of line
1398 * segments that you emit is constantly changing. This completely destroys our caching strategy here. For after the first animated cubic spline segment that enters the meshbuilder all other
1399 * segments will need to be completely remade and reuploaded to the GPU. It's better in most cases to burn through extra vertices to have a shot at a fixed geometry layout in most cases. If
1400 * you want a recursive flattening renderCubicTo, add one here by all means, that's why you can pass in a different Function3 here.
1401 */
1402 @HiddenInAutocomplete
1403 public Curry.Function3<MeshAcceptor, Node, CubicTo, Node> renderCubicTo(int fixedSize) {

Callers 1

closestPointToMethod · 0.95

Calls 3

closestTMethod · 0.95
cursorMethod · 0.95
setTMethod · 0.80

Tested by

no test coverage detected