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

Method __sub__

src/main/java/field/linalg/Vec4.java:1422–1440  ·  view source on GitHub ↗
(Object b)

Source from the content-addressed store, hash-verified

1420
1421 }
1422
1423 @Override
1424 public Object __sub__(Object b) {
1425 Vec4 c = convertToVec4(b);
1426 if (c != null)
1427 return new Vec4(this.x - c.x, this.y - c.y, this.z - c.z, this.w - c.w);
1428
1429 if (b instanceof Quat) {
1430 return ((Quat) b).transform(this, new Vec4());
1431 }
1432 if (b instanceof Vec4) {
1433 return this.add((Vec4) b);
1434 }
1435
1436 if (b instanceof OverloadedMath)
1437 return ((OverloadedMath) b).__rsub__(this);
1438
1439 throw new ClassCastException(" can't sub '" + b + "' by a Vec3 (" + this + ")");
1440
1441 }
1442
1443

Callers

nothing calls this directly

Calls 4

convertToVec4Method · 0.95
addMethod · 0.95
transformMethod · 0.65
__rsub__Method · 0.65

Tested by

no test coverage detected