Vector3 projectOnVector(Vector3 v) { var denominator = v.lengthSq(); if (denominator == 0) return set(0, 0, 0); var scalar = v.dot(this) / denominator; return copy(v).multiplyScalar(scalar); }