mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 19:42:10 +00:00
parent
91615f9588
commit
460b375cad
3 changed files with 40 additions and 20 deletions
|
@ -39,6 +39,7 @@ struct ServerActiveObjectMap
|
|||
{
|
||||
ServerActiveObject *object;
|
||||
aabb3s16 box;
|
||||
v3s16 pos;
|
||||
bool has_box;
|
||||
};
|
||||
|
||||
|
@ -108,9 +109,6 @@ struct ServerActiveObjectMap
|
|||
* @note Due to inexact nature of floating-point computations, it is
|
||||
* undefined whether an object lying exactly at the boundary is included
|
||||
* in the list or not.
|
||||
* @note Objects with base position outside of the collision box may not
|
||||
* be returned.
|
||||
* @note Objects without valid collision box are not returned.
|
||||
*/
|
||||
std::vector<u16> getObjectsInsideRadius(v3f pos, float radius);
|
||||
|
||||
|
@ -134,6 +132,8 @@ struct ServerActiveObjectMap
|
|||
const std::unordered_map<u16, Wrapper> &getObjects() const { return objects; }
|
||||
|
||||
private:
|
||||
void addObjectRef(u16 id, v3s16 pos);
|
||||
void removeObjectRef(u16 id, v3s16 pos);
|
||||
void addObjectRefs(u16 id, const aabb3s16 &box);
|
||||
void removeObjectRefs(u16 id, const aabb3s16 &box);
|
||||
std::unordered_set<u16> getObjectsNearBox(const aabb3s16 &box);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue