mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add vector.in_area()
utility function (#13390)
This commit is contained in:
parent
2fc7eb3ea2
commit
68f81ace97
3 changed files with 18 additions and 0 deletions
|
@ -3540,6 +3540,11 @@ vectors are written like this: `(x, y, z)`:
|
|||
* Returns a boolean value indicating whether `v` is a real vector, eg. created
|
||||
by a `vector.*` function.
|
||||
* Returns `false` for anything else, including tables like `{x=3,y=1,z=4}`.
|
||||
* `vector.in_area(pos, min, max)`:
|
||||
* Returns a boolean value indicating if `pos` is inside area formed by `min` and `max`.
|
||||
* `min` and `max` are inclusive.
|
||||
* If `min` is bigger than `max` on some axis, function always returns false.
|
||||
* You can use `vector.sort` if you have two vectors and don't know which are the minimum and the maximum.
|
||||
|
||||
For the following functions `x` can be either a vector or a number:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue