vadd method

Vec3 vadd(
  1. Vec3 vector, [
  2. Vec3? target
])

Vector addition

Implementation

Vec3 vadd(Vec3 vector, [Vec3? target]){
  if (target != null) {
    target.x = vector.x + x;
    target.y = vector.y + y;
    target.z = vector.z + z;
    return target;
  } else {
    return Vec3(x + vector.x, y + vector.y, z + vector.z);
  }
}