mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01:00
lua_api.txt: improve vector documentation
Before it rendered very badly in HTML. Also point out what vector.round does.
This commit is contained in:
parent
3132bcb373
commit
d915ca1124
@ -1688,16 +1688,15 @@ or string form, a ColorString (defined above):
|
|||||||
`colorspec = "green"`
|
`colorspec = "green"`
|
||||||
|
|
||||||
Spatial Vectors
|
Spatial Vectors
|
||||||
--------------
|
---------------
|
||||||
|
* `vector.new(a[, b, c])`: returns a vector:
|
||||||
* `vector.new([x[, y, z]])`: returns a vector.
|
* A copy of `a` if `a` is a vector.
|
||||||
* `x` is a table or the `x` position.
|
* `{x = a, y = b, z = c}`, if all `a, b, c` are defined
|
||||||
|
|
||||||
* `vector.direction(p1, p2)`: returns a vector
|
* `vector.direction(p1, p2)`: returns a vector
|
||||||
* `vector.distance(p1, p2)`: returns a number
|
* `vector.distance(p1, p2)`: returns a number
|
||||||
* `vector.length(v)`: returns a number
|
* `vector.length(v)`: returns a number
|
||||||
* `vector.normalize(v)`: returns a vector
|
* `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.apply(v, func)`: returns a vector
|
||||||
* `vector.equals(v1, v2)`: returns a boolean
|
* `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
|
* `vector.divide(v, x)`: returns a scaled vector or Schur quotient
|
||||||
|
|
||||||
Helper functions
|
Helper functions
|
||||||
-----------------
|
----------------
|
||||||
* `dump2(obj, name="_", dumped={})`
|
* `dump2(obj, name="_", dumped={})`
|
||||||
* Return object serialized as a string, handles reference loops
|
* Return object serialized as a string, handles reference loops
|
||||||
* `dump(obj, dumped={})`
|
* `dump(obj, dumped={})`
|
||||||
|
Loading…
Reference in New Issue
Block a user