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

Method __radd__

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

Source from the content-addressed store, hash-verified

1481 }
1482
1483 @Override
1484 public Object __radd__(Object b) {
1485 Vec2 c = convertToVec2(b);
1486 if (c != null)
1487 return new Vec2(this.x + c.x, this.y + c.y);
1488
1489 if (b instanceof Quat) {
1490 return ((Quat) b).invert(new Quat()).transform(this, new Vec2());
1491 }
1492
1493 if (b instanceof Vec4) {
1494 return this.toVec4().add((Vec4) b);
1495 }
1496
1497 throw new ClassCastException(" can't add '" + b + "' by a Vec2 (" + this + ")");
1498
1499 }
1500
1501 @Override
1502 public Object __mul__(Object b) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected