Add a to b and store the result in dest . @param a the first addend @param b the second addend @param dest will hold the result
(Vec2 a, Vec2 b, Vec2 dest)
| 249 | * @param dest will hold the result |
| 250 | */ |
| 251 | public static Vec2 add(Vec2 a, Vec2 b, Vec2 dest) { |
| 252 | if (dest == null) dest = new Vec2(); |
| 253 | dest.x = a.x + b.x; |
| 254 | dest.y = a.y + b.y; |
| 255 | return dest; |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * returns x*w+y in dest |