| 1542 | |
| 1543 | } |
| 1544 | @Override |
| 1545 | public Object __div__(Object b) { |
| 1546 | if (b instanceof Number) |
| 1547 | return new Vec2(this).mul(1.0/((Number) b).doubleValue()); |
| 1548 | |
| 1549 | Vec2 c = convertToVec2(b); |
| 1550 | if (c != null) |
| 1551 | return new Vec2(this.x / c.x, this.y / c.y); |
| 1552 | |
| 1553 | if (b instanceof Quat) { |
| 1554 | return ((Quat) b).transform(this, new Vec2()); |
| 1555 | } |
| 1556 | |
| 1557 | if (b instanceof Vec4) { |
| 1558 | return ((Vec4)b).div(this.toVec4()); |
| 1559 | } |
| 1560 | |
| 1561 | if (b instanceof OverloadedMath) |
| 1562 | return ((OverloadedMath) b).__rdiv__(this); |
| 1563 | |
| 1564 | throw new ClassCastException(" can't divide'" + b + "' and a Vec2 (" + this + ")"); |
| 1565 | } |
| 1566 | |
| 1567 | @Override |
| 1568 | public Object __rdiv__(Object b) { |