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

Method __rsub__

src/main/java/field/linalg/Vec2.java:1446–1461  ·  view source on GitHub ↗
(Object b)

Source from the content-addressed store, hash-verified

1444 }
1445
1446 @Override
1447 public Object __rsub__(Object b) {
1448 Vec2 c = convertToVec2(b);
1449 if (c != null)
1450 return new Vec3(c.x - this.x, c.y - this.y);
1451 if (b instanceof Quat) {
1452 return ((Quat) b).transform(this, new Vec2());
1453 }
1454 if (b instanceof Vec4) {
1455 return this.toVec4().mul(-1).add((Vec4) b);
1456 }
1457
1458
1459 throw new ClassCastException(" can't subtract '" + b + "' by a Vec3 (" + this + ")");
1460
1461 }
1462
1463 @Override
1464 public Object __add__(Object b) {

Callers

nothing calls this directly

Calls 5

convertToVec2Method · 0.95
toVec4Method · 0.95
transformMethod · 0.65
addMethod · 0.45
mulMethod · 0.45

Tested by

no test coverage detected