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

Method __rmul__

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

Source from the content-addressed store, hash-verified

1831 }
1832
1833 @Override
1834 public Object __rmul__(Object b) {
1835 if (b instanceof Number)
1836 return new Vec3(this).mul(((Number) b).doubleValue());
1837
1838 Vec3 c = convertToVec3(b);
1839 if (c != null)
1840 return new Vec3(this.x * c.x, this.y * c.y, this.z * c.z);
1841
1842 if (b instanceof Quat) {
1843 return ((Quat) b).invert(new Quat()).transform(this, new Vec3());
1844 }
1845
1846 if (b instanceof Vec4) {
1847 return this.toVec4().mul((Vec4) b);
1848 }
1849
1850 throw new ClassCastException(" can't multiply '" + b + "' by a Vec3 (" + this + ")");
1851
1852 }
1853 @Override
1854 public Object __div__(Object b) {
1855 if (b instanceof Number)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected