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

Method __add__

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

Source from the content-addressed store, hash-verified

1441 }
1442
1443
1444 @Override
1445 public Object __add__(Object b) {
1446 Vec4 c = convertToVec4(b);
1447 if (c != null)
1448 return new Vec4(this.x + c.x, this.y + c.y, this.z + c.z, this.w + c.w);
1449
1450 if (b instanceof Quat) {
1451 return ((Quat) b).transform(this, new Vec4());
1452 }
1453 if (b instanceof Vec4) {
1454 return this.add((Vec4) b);
1455 }
1456
1457 if (b instanceof OverloadedMath)
1458 return ((OverloadedMath) b).__radd__(this);
1459
1460 throw new ClassCastException(" can't add '" + b + "' by a Vec3 (" + this + ")");
1461
1462 }
1463
1464 @Override

Callers

nothing calls this directly

Calls 4

convertToVec4Method · 0.95
addMethod · 0.95
transformMethod · 0.65
__radd__Method · 0.65

Tested by

no test coverage detected