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

Method __rmul__

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

Source from the content-addressed store, hash-verified

1527 throw new ClassCastException(" can't divide '" + b + "' by a Vec4 (" + this + ")");
1528 }
1529
1530 @Override
1531 public Object __rmul__(Object b) {
1532 if (b instanceof Number)
1533 return new Vec4(this.x * ((Number) b).doubleValue(), this.y * ((Number) b).doubleValue(), this.z * ((Number) b).doubleValue(), this.w * ((Number) b).doubleValue());
1534
1535 Vec4 c = convertToVec4(b);
1536 if (c != null)
1537 return new Vec4(this.x * c.x, this.y * c.y, this.z * c.z, this.w * c.w);
1538
1539 if (b instanceof Quat) {
1540 return ((Quat) b).invert(new Quat()).transform(this, new Vec4());
1541 }
1542
1543 if (b instanceof Vec4) {
1544 return this.mul((Vec4) b);
1545 }
1546
1547 throw new ClassCastException(" can't multiply '" + b + "' by a Vec3 (" + this + ")");
1548
1549 }
1550
1551 @Override

Callers

nothing calls this directly

Calls 4

convertToVec4Method · 0.95
mulMethod · 0.95
transformMethod · 0.65
invertMethod · 0.45

Tested by

no test coverage detected