| 1425 | } |
| 1426 | |
| 1427 | @Override |
| 1428 | public Object __sub__(Object b) { |
| 1429 | Vec2 c = convertToVec2(b); |
| 1430 | if (c != null) |
| 1431 | return new Vec3(this.x - c.x, this.y - c.y); |
| 1432 | |
| 1433 | if (b instanceof Quat) { |
| 1434 | return ((Quat) b).invert(new Quat()).transform(this, new Vec2()); |
| 1435 | } |
| 1436 | if (b instanceof Vec4) { |
| 1437 | return this.toVec4().sub((Vec4) b); |
| 1438 | } |
| 1439 | if (b instanceof OverloadedMath) |
| 1440 | return ((OverloadedMath) b).__rsub__(this); |
| 1441 | |
| 1442 | throw new ClassCastException(" can't subtract '" + b + "' by a Vec3 (" + this + ")"); |
| 1443 | |
| 1444 | } |
| 1445 | |
| 1446 | @Override |
| 1447 | public Object __rsub__(Object b) { |