| 1734 | // todo: matrix? |
| 1735 | |
| 1736 | @Override |
| 1737 | public Object __sub__(Object b) { |
| 1738 | Vec3 c = convertToVec3(b); |
| 1739 | if (c != null) |
| 1740 | return new Vec3(this.x - c.x, this.y - c.y, this.z - c.z); |
| 1741 | |
| 1742 | if (b instanceof Quat) { |
| 1743 | return ((Quat) b).invert(new Quat()).transform(this, new Vec3()); |
| 1744 | } |
| 1745 | if (b instanceof Vec4) { |
| 1746 | return this.toVec4().sub((Vec4) b); |
| 1747 | } |
| 1748 | if (b instanceof OverloadedMath) |
| 1749 | return ((OverloadedMath) b).__rsub__(this); |
| 1750 | |
| 1751 | throw new ClassCastException(" can't subtract '" + b + "' by a Vec3 (" + this + ")"); |
| 1752 | |
| 1753 | } |
| 1754 | |
| 1755 | @Override |
| 1756 | public Object __rsub__(Object b) { |