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

Method __rsub__

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

Source from the content-addressed store, hash-verified

1753 }
1754
1755 @Override
1756 public Object __rsub__(Object b) {
1757 Vec3 c = convertToVec3(b);
1758 if (c != null)
1759 return new Vec3(c.x - this.x, c.y - this.y, c.z - this.z);
1760 if (b instanceof Quat) {
1761 return ((Quat) b).transform(this, new Vec3());
1762 }
1763 if (b instanceof Vec4) {
1764 return this.toVec4().mul(-1).add((Vec4) b);
1765 }
1766
1767
1768 throw new ClassCastException(" can't subtract '" + b + "' by a Vec3 (" + this + ")");
1769
1770 }
1771
1772 @Override
1773 public Object __add__(Object b) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected