Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public func += (left: inout Vector3D, right: Vector3D) {
- left = left + right
- }
- var initialVector = Vector3D(x: 1.0, y: 2.0, z:3.0)
- let vectorToAdd = Vector3D(x: 3.0, y: 4.0, z:5.0)
- initialVector += vectorToAdd /* initial vector now has: x = 4, y = 6, z = 8 */
Add Comment
Please, Sign In to add comment