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

Method __radd__

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

Source from the content-addressed store, hash-verified

1461
1462 }
1463
1464 @Override
1465 public Object __radd__(Object b) {
1466 Vec4 c = convertToVec4(b);
1467 if (c != null)
1468 return new Vec4(this.x + c.x, this.y + c.y, this.z + c.z, this.w + c.w);
1469
1470 if (b instanceof Quat) {
1471 return ((Quat) b).invert(new Quat()).transform(this, new Vec4());
1472 }
1473
1474 if (b instanceof Vec4) {
1475 return this.add((Vec4) b);
1476 }
1477
1478 throw new ClassCastException(" can't add '" + b + "' by a Vec3 (" + this + ")");
1479
1480 }
1481
1482 @Override

Callers

nothing calls this directly

Calls 4

convertToVec4Method · 0.95
addMethod · 0.95
transformMethod · 0.65
invertMethod · 0.45

Tested by

no test coverage detected