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

Method __radd__

src/main/java/field/linalg/Vec3.java:1792–1808  ·  view source on GitHub ↗
(Object b)

Source from the content-addressed store, hash-verified

1790 }
1791
1792 @Override
1793 public Object __radd__(Object b) {
1794 Vec3 c = convertToVec3(b);
1795 if (c != null)
1796 return new Vec3(this.x + c.x, this.y + c.y, this.z + c.z);
1797
1798 if (b instanceof Quat) {
1799 return ((Quat) b).invert(new Quat()).transform(this, new Vec3());
1800 }
1801
1802 if (b instanceof Vec4) {
1803 return this.toVec4().add((Vec4) b);
1804 }
1805
1806 throw new ClassCastException(" can't add '" + b + "' by a Vec3 (" + this + ")");
1807
1808 }
1809
1810 @Override
1811 public Object __mul__(Object b) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected