(x, y, z, w)
| 45 | _.sourceTransformer = __h__.transformer(_) |
| 46 | |
| 47 | var vec = function (x, y, z, w) { |
| 48 | if (arguments.length == 0) return new Vec4(0, 0, 0, 1) |
| 49 | if (arguments.length == 1) return new Vec4(x, x, x, 1) |
| 50 | if (arguments.length == 2) return new Vec2(x, y) |
| 51 | if (arguments.length == 3) return new Vec3(x, y, z) |
| 52 | if (arguments.length == 4) return new Vec4(x, y, z, w) |
| 53 | throw "can't make a vector given this (" + arguments.length + ") number of arguments" |
| 54 | } |
| 55 | |
| 56 | vec.__doc__ = "shorthand for creating a vector. `vec(1,2,3)` makes a `Vec3`, while `vec(4,-2.3)` makes a `Vec2` etc." |
| 57 |
no outgoing calls
no test coverage detected