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

Method __mul__

src/main/java/field/linalg/Vec4.java:1481–1502  ·  view source on GitHub ↗
(Object b)

Source from the content-addressed store, hash-verified

1479
1480 }
1481
1482 @Override
1483 public Object __mul__(Object b) {
1484 if (b instanceof Number)
1485 return new Vec4(this.x * ((Number) b).doubleValue(), this.y * ((Number) b).doubleValue(), this.z * ((Number) b).doubleValue(), this.w * ((Number) b).doubleValue());
1486
1487 Vec4 c = convertToVec4(b);
1488 if (c != null)
1489 return new Vec4(this.x * c.x, this.y * c.y, this.z * c.z, this.w * c.w);
1490
1491 if (b instanceof Quat) {
1492 return ((Quat) b).transform(this, new Vec4());
1493 }
1494
1495 if (b instanceof Vec4) {
1496 return this.mul((Vec4) b);
1497 }
1498
1499 if (b instanceof OverloadedMath)
1500 return ((OverloadedMath) b).__rmul__(this);
1501
1502 throw new ClassCastException(" can't multiply '" + b + "' by a Vec3 (" + this + ")");
1503 }
1504
1505 @Override

Callers

nothing calls this directly

Calls 4

convertToVec4Method · 0.95
mulMethod · 0.95
transformMethod · 0.65
__rmul__Method · 0.65

Tested by

no test coverage detected