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

Method __rmul__

src/main/java/field/linalg/Vec2.java:1524–1543  ·  view source on GitHub ↗
(Object b)

Source from the content-addressed store, hash-verified

1522 }
1523
1524 @Override
1525 public Object __rmul__(Object b) {
1526 if (b instanceof Number)
1527 return new Vec2(this).mul(((Number) b).doubleValue());
1528
1529 Vec2 c = convertToVec2(b);
1530 if (c != null)
1531 return new Vec2(this.x * c.x, this.y * c.y);
1532
1533 if (b instanceof Quat) {
1534 return ((Quat) b).invert(new Quat()).transform(this, new Vec2());
1535 }
1536
1537 if (b instanceof Vec4) {
1538 return this.toVec4().mul((Vec4) b);
1539 }
1540
1541 throw new ClassCastException(" can't multiply '" + b + "' by a Vec2 (" + this + ")");
1542
1543 }
1544 @Override
1545 public Object __div__(Object b) {
1546 if (b instanceof Number)

Callers

nothing calls this directly

Calls 5

convertToVec2Method · 0.95
toVec4Method · 0.95
transformMethod · 0.65
mulMethod · 0.45
invertMethod · 0.45

Tested by

no test coverage detected