1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 08:05:18 +02:00

Add vector.random_direction() (#14784)

Generate a random vector of unit length. Useful for many mods.
This commit is contained in:
Erich Schubert
2024-08-13 18:38:07 +02:00
committed by GitHub
parent cb0bbea2a5
commit e6f77b95f3
2 changed files with 14 additions and 0 deletions

View File

@@ -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])`: