addScaledVector method

Vec3 addScaledVector(
  1. double scalar,
  2. Vec3 vector, [
  3. Vec3? target
])

Scale a vector and add it to this vector. Save the result in "target". (target = this + vector * scalar) @param target The vector to save the result in.

Implementation

Vec3 addScaledVector(double scalar, Vec3 vector, [Vec3? target]) {
  target ??= Vec3();
  target.x = x + scalar * vector.x;
  target.y = y + scalar * vector.y;
  target.z = z + scalar * vector.z;
  return target;
}