Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
activeobjectmgr.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2010-2018 nerzhul, Loic BLOT <loic.blot@unix-experience.fr>
4
5#pragma once
6
7#include <functional>
8#include <vector>
10#include "serveractiveobject.h"
11
12namespace server
13{
14class ActiveObjectMgr final : public ::ActiveObjectMgr<ServerActiveObject>
15{
16public:
17 ~ActiveObjectMgr() override;
18
19 // If cb returns true, the obj will be deleted
20 void clearIf(const std::function<bool(ServerActiveObject *, u16)> &cb);
21 void step(float dtime,
22 const std::function<void(ServerActiveObject *)> &f) override;
23 bool registerObject(std::unique_ptr<ServerActiveObject> obj) override;
24 void removeObject(u16 id) override;
25
27
28 void getObjectsInsideRadius(const v3f &pos, float radius,
29 std::vector<ServerActiveObject *> &result,
30 std::function<bool(ServerActiveObject *obj)> include_obj_cb);
31 void getObjectsInArea(const aabb3f &box,
32 std::vector<ServerActiveObject *> &result,
33 std::function<bool(ServerActiveObject *obj)> include_obj_cb);
35 const v3f &player_pos, const std::string &player_name,
36 f32 radius, f32 player_radius,
37 const std::set<u16> &current_objects,
38 std::vector<u16> &added_objects);
39};
40} // namespace server
Definition activeobjectmgr.h:18
Definition serveractiveobject.h:41
Definition activeobjectmgr.h:15
~ActiveObjectMgr() override
Definition activeobjectmgr.cpp:13
void getObjectsInArea(const aabb3f &box, std::vector< ServerActiveObject * > &result, std::function< bool(ServerActiveObject *obj)> include_obj_cb)
Definition activeobjectmgr.cpp:134
void step(float dtime, const std::function< void(ServerActiveObject *)> &f) override
Definition activeobjectmgr.cpp:34
void getObjectsInsideRadius(const v3f &pos, float radius, std::vector< ServerActiveObject * > &result, std::function< bool(ServerActiveObject *obj)> include_obj_cb)
Definition activeobjectmgr.cpp:116
void invalidateActiveObjectObserverCaches()
Definition activeobjectmgr.cpp:106
void removeObject(u16 id) override
Definition activeobjectmgr.cpp:93
void clearIf(const std::function< bool(ServerActiveObject *, u16)> &cb)
Definition activeobjectmgr.cpp:22
bool registerObject(std::unique_ptr< ServerActiveObject > obj) override
Definition activeobjectmgr.cpp:49
void getAddedActiveObjectsAroundPos(const v3f &player_pos, const std::string &player_name, f32 radius, f32 player_radius, const std::set< u16 > &current_objects, std::vector< u16 > &added_objects)
Definition activeobjectmgr.cpp:151
core::aabbox3d< f32 > aabb3f
Definition irr_aabb3d.h:11
core::vector3df v3f
Definition irr_v3d.h:11
Definition activeobjectmgr.cpp:11