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

Method __rsub__

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

Source from the content-addressed store, hash-verified

1402 }
1403
1404
1405 @Override
1406 public Object __rsub__(Object b) {
1407 Vec4 c = convertToVec4(b);
1408 if (c != null)
1409 return new Vec4(c.x - this.x, c.y - this.y, c.z - this.z, c.w - this.w);
1410
1411 if (b instanceof Quat) {
1412 return ((Quat) b).transform(this, new Vec4());
1413 }
1414 if (b instanceof Vec4) {
1415 return this.mul(-1).add((Vec4) b);
1416 }
1417
1418
1419 throw new ClassCastException(" can't subtract '" + b + "' by a Vec3 (" + this + ")");
1420
1421 }
1422
1423 @Override

Callers

nothing calls this directly

Calls 4

convertToVec4Method · 0.95
mulMethod · 0.95
transformMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected