MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / vec

Function vec

src/main/java/fieldnashorn/Nashorn.stdlib.js:47–54  ·  view source on GitHub ↗
(x, y, z, w)

Source from the content-addressed store, hash-verified

45_.sourceTransformer = __h__.transformer(_)
46
47var 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
56vec.__doc__ = "shorthand for creating a vector. `vec(1,2,3)` makes a `Vec3`, while `vec(4,-2.3)` makes a `Vec2` etc."
57

Callers 15

stop.box.jsFile · 0.50
play.box.jsFile · 0.50
shortcuts.box.jsFile · 0.50
sound file.box.jsFile · 0.50
replay.box.jsFile · 0.50
reset.box.jsFile · 0.50
demo.box.jsFile · 0.50
t_fadeplane.box.jsFile · 0.50
play.box.jsFile · 0.50
sound file.box.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected