aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-03-19 09:18:22 +0100
committerest31 <MTest31@outlook.com>2016-03-19 15:34:51 +0100
commitd915ca11249050fd67a87ebee16ca2b2f67f93d5 (patch)
tree83615f22eac1fdd43be2e3a7bf3132a6dbddb3a0 /doc
parent3132bcb3732df51c08c8b2f34781e463cd94fe7f (diff)
downloadminetest-d915ca11249050fd67a87ebee16ca2b2f67f93d5.tar.gz
minetest-d915ca11249050fd67a87ebee16ca2b2f67f93d5.tar.bz2
minetest-d915ca11249050fd67a87ebee16ca2b2f67f93d5.zip
lua_api.txt: improve vector documentation
Before it rendered very badly in HTML. Also point out what vector.round does.
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt13
1 files changed, 6 insertions, 7 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 733ac8412..a01e72889 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1688,16 +1688,15 @@ or string form, a ColorString (defined above):
`colorspec = "green"`
Spatial Vectors
---------------
-
-* `vector.new([x[, y, z]])`: returns a vector.
- * `x` is a table or the `x` position.
-
+---------------
+* `vector.new(a[, b, c])`: returns a vector:
+ * A copy of `a` if `a` is a vector.
+ * `{x = a, y = b, z = c}`, if all `a, b, c` are defined
* `vector.direction(p1, p2)`: returns a vector
* `vector.distance(p1, p2)`: returns a number
* `vector.length(v)`: returns a number
* `vector.normalize(v)`: returns a vector
-* `vector.round(v)`: returns a vector
+* `vector.round(v)`: returns a vector, each dimension rounded to floor
* `vector.apply(v, func)`: returns a vector
* `vector.equals(v1, v2)`: returns a boolean
@@ -1709,7 +1708,7 @@ For the following functions `x` can be either a vector or a number:
* `vector.divide(v, x)`: returns a scaled vector or Schur quotient
Helper functions
------------------
+----------------
* `dump2(obj, name="_", dumped={})`
* Return object serialized as a string, handles reference loops
* `dump(obj, dumped={})`