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

Method __mul__

src/main/java/field/linalg/Vec3.java:1810–1831  ·  view source on GitHub ↗
(Object b)

Source from the content-addressed store, hash-verified

1808 }
1809
1810 @Override
1811 public Object __mul__(Object b) {
1812 if (b instanceof Number)
1813 return new Vec3(this).mul(((Number) b).doubleValue());
1814
1815 Vec3 c = convertToVec3(b);
1816 if (c != null)
1817 return new Vec3(this.x * c.x, this.y * c.y, this.z * c.z);
1818
1819 if (b instanceof Quat) {
1820 return ((Quat) b).transform(this, new Vec3());
1821 }
1822
1823 if (b instanceof Vec4) {
1824 return this.toVec4().mul((Vec4) b);
1825 }
1826
1827 if (b instanceof OverloadedMath)
1828 return ((OverloadedMath) b).__rmul__(this);
1829
1830 throw new ClassCastException(" can't multiply '" + b + "' by a Vec3 (" + this + ")");
1831 }
1832
1833 @Override
1834 public Object __rmul__(Object b) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected