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

Method copyToFlipped

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

copies a node from (potentially some other) line to here. Also copies attributes. Cubic segments are reversed.

(Node node, Vec3 dest)

Source from the content-addressed store, hash-verified

771 } else if (node instanceof LineTo) {
772 this.lineTo(dest);
773 this.last().attributes.putAll(node.attributes.duplicate());
774 return this;
775 } else if (node instanceof CubicTo) {
776 this.cubicTo(((CubicTo) node).c2, ((CubicTo) node).c1, dest);
777 this.last().attributes.putAll(node.attributes.duplicate());
778 return this;
779 }
780 throw new Error();
781 }
782
783 /**
784 * "smoothly" builds a cubic segment to this point. This will rewrite the previous node to have the correct tangent.
785 *
786 * @param v
787 */
788 public FLine smoothTo(Vec2 v) {
789 return smoothTo(v.toVec3());
790 }
791

Callers 1

railMethod · 0.80

Calls 6

moveToMethod · 0.95
lastMethod · 0.95
lineToMethod · 0.95
cubicToMethod · 0.95
putAllMethod · 0.80
duplicateMethod · 0.65

Tested by

no test coverage detected