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

Method __mul__

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

Source from the content-addressed store, hash-verified

1499 }
1500
1501 @Override
1502 public Object __mul__(Object b) {
1503 if (b instanceof Number)
1504 return new Vec2(this).mul(((Number) b).doubleValue());
1505
1506 Vec2 c = convertToVec2(b);
1507 if (c != null)
1508 return new Vec2(this.x * c.x, this.y * c.y);
1509
1510 if (b instanceof Quat) {
1511 return ((Quat) b).transform(this, new Vec2());
1512 }
1513
1514 if (b instanceof Vec4) {
1515 return this.toVec4().mul((Vec4) b);
1516 }
1517
1518 if (b instanceof OverloadedMath)
1519 return ((OverloadedMath) b).__rmul__(this);
1520
1521 throw new ClassCastException(" can't multiply '" + b + "' by a Vec2 (" + this + ")");
1522 }
1523
1524 @Override
1525 public Object __rmul__(Object b) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected