operator * method

Vector3 operator *(
  1. dynamic v
)

Implementation

Vector3 operator *(dynamic v) {
  if (v is num) {
    return Vector3(x * v, y * v, z * v);
  } else if (v is Vector3) {
    return Vector3(x * v.x, y * v.y, z * v.z);
  } else {
    throw 'Vector3 only support multiplication by num or Vector3';
  }
}