Add a vector to another vector and place the result in a destination vector. @param left The LHS vector @param right The RHS vector @param dest The destination vector, or null if a new vector is to be created @return the sum of left and right in dest
(Vector2f left, Vector2f right, Vector2f dest)
| 188 | * @return the sum of left and right in dest |
| 189 | */ |
| 190 | public static Vector2f add(Vector2f left, Vector2f right, Vector2f dest) { |
| 191 | if (dest == null) |
| 192 | return new Vector2f(left.x + right.x, left.y + right.y); |
| 193 | else { |
| 194 | dest.set(left.x + right.x, left.y + right.y); |
| 195 | return dest; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * Subtract a vector from another vector and place the result in a destination |
no test coverage detected