add method

PVector add(
  1. PVector v
)

( begin auto-generated from PVector_add.xml )

Adds x, y, and z components to a vector, adds one vector to another, or adds two independent vectors together. The version of the method that adds two vectors together is a static method and returns a PVector, the others have no return value -- they act directly on the vector. See the examples for more context.

( end auto-generated )

@webref pvector:method @usage web_application @param v the vector to be added @brief Adds x, y, and z components to a vector, one vector to another, or two independent vectors

Implementation

PVector add(PVector v) {
  x += v.x;
  y += v.y;
  z += v.z;
  return this;
}