add3 static method

PVector add3(
  1. PVector v1,
  2. PVector v2,
  3. PVector? target
)

Add two vectors into a target vector @param target the target vector (if null, a new vector will be created)

Implementation

static PVector add3(PVector v1, PVector v2, PVector? target) {
  if (target == null) {
    target = new PVector(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z);
  } else {
    target.set(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z);
  }
  return target;
}