mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add vector.random_direction()
(#14784)
Generate a random vector of unit length. Useful for many mods.
This commit is contained in:
parent
cb0bbea2a5
commit
e6f77b95f3
2 changed files with 14 additions and 0 deletions
|
@ -3820,6 +3820,8 @@ vectors are written like this: `(x, y, z)`:
|
|||
`vector.new(v)` does the same as `vector.copy(v)`
|
||||
* `vector.zero()`:
|
||||
* Returns a new vector `(0, 0, 0)`.
|
||||
* `vector.random_direction()`:
|
||||
* Returns a new vector of length 1, pointing into a direction chosen uniformly at random.
|
||||
* `vector.copy(v)`:
|
||||
* Returns a copy of the vector `v`.
|
||||
* `vector.from_string(s[, init])`:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue