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

Method __div__

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

Source from the content-addressed store, hash-verified

1851
1852 }
1853 @Override
1854 public Object __div__(Object b) {
1855 if (b instanceof Number)
1856 return new Vec3(this).mul(1.0/((Number) b).doubleValue());
1857
1858 Vec3 c = convertToVec3(b);
1859 if (c != null)
1860 return new Vec3(this.x / c.x, this.y / c.y, this.z / c.z);
1861
1862 if (b instanceof Quat) {
1863 return ((Quat) b).transform(this, new Vec3());
1864 }
1865
1866 if (b instanceof Vec4) {
1867 return ((Vec4)b).div(this.toVec4());
1868 }
1869
1870 if (b instanceof OverloadedMath)
1871 return ((OverloadedMath) b).__rdiv__(this);
1872
1873 throw new ClassCastException(" can't divide'" + b + "' and a Vec3 (" + this + ")");
1874 }
1875
1876 @Override
1877 public Object __rdiv__(Object b) {

Callers

nothing calls this directly

Calls 6

convertToVec3Method · 0.95
toVec4Method · 0.95
transformMethod · 0.65
__rdiv__Method · 0.65
mulMethod · 0.45
divMethod · 0.45

Tested by

no test coverage detected