add entities.get_all(...), .get_all_in_box(...), .get_all_in_radius(...)

This commit is contained in:
MihailRis
2024-07-17 14:51:55 +03:00
parent b499714d4b
commit 1eac343619
7 changed files with 100 additions and 0 deletions
+16
View File
@@ -14,6 +14,22 @@ entities.spawn(name: str, pos: vec3, [optional] args: table)
-- Checks the existence of an entity by a unique identifier.
entities.exists(uid: int) -> bool
-- Returns a table of all loaded entities
entities.get_all() -> table
-- Returns a table of loaded entities based on the passed list of UIDs
entities.get_all(uids: array<int>) -> table
-- Returns a list of UIDs of entities inside the rectangular area
-- pos - minimal area corner
-- size - area size
entities.get_all_in_box(pos: vec3, size: vec3) -> array<int>
-- Returns a list of UIDs of entities inside the radius
-- center - center of the area
-- radius - radius of the area
entities.get_all_in_radius(center: vec3, radius: number) -> array<int>
```
```lua