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

Method __rsub__

src/main/java/field/graphics/FLine.java:1922–1946  ·  view source on GitHub ↗
(Object b)

Source from the content-addressed store, hash-verified

1920 return byTransforming(x -> new Vec3(x).sub(finalB));
1921 } else if (b instanceof Vec3) {
1922 Vec3 finalB = (Vec3) b;
1923 return byTransforming(x -> new Vec3(x).sub(finalB));
1924 } else if (b instanceof Quat) {
1925 Quat finalB = (Quat) b;
1926 return byTransforming(x -> finalB.invert(new Quat()).transform(x, new Vec3()));
1927 } else if (b instanceof FLine) {
1928 Shape s1 = FLinesAndJavaShapes.flineToJavaShape(this);
1929 Shape s2 = FLinesAndJavaShapes.flineToJavaShape((FLine) b);
1930
1931 Area a1 = new Area(s1);
1932 Area a2 = new Area(s2);
1933 a1.subtract(a2);
1934 FLine ret = FLinesAndJavaShapes.javaShapeToFLine(a1);
1935 ret.attributes = this.attributes.duplicate(ret);
1936 return ret;
1937 }
1938 throw new ClassCastException(" can't subtract '" + b + "' from this FLine");
1939 }
1940
1941 @Override
1942 public Object __add__(Object b) {
1943 if (b instanceof Vec2) {
1944 Vec3 finalB = ((Vec2) b).toVec3();
1945 return byTransforming(x -> new Vec3(x).add(finalB));
1946 } else if (b instanceof Vec3) {
1947 Vec3 finalB = (Vec3) b;
1948 return byTransforming(x -> new Vec3(x).add(finalB));
1949 } else if (b instanceof Quat) {

Callers

nothing calls this directly

Calls 9

byTransformingMethod · 0.95
invertMethod · 0.95
flineToJavaShapeMethod · 0.95
javaShapeToFLineMethod · 0.95
subtractMethod · 0.80
transformMethod · 0.65
duplicateMethod · 0.65
toVec3Method · 0.45
subMethod · 0.45

Tested by

no test coverage detected