Minetest  5.4.0
server::ActiveObjectMgr Class Reference

#include <activeobjectmgr.h>

+ Inheritance diagram for server::ActiveObjectMgr:
+ Collaboration diagram for server::ActiveObjectMgr:

Public Member Functions

void clear (const std::function< bool(ServerActiveObject *, u16)> &cb)
 
void step (float dtime, const std::function< void(ServerActiveObject *)> &f) override
 
bool registerObject (ServerActiveObject *obj) override
 
void removeObject (u16 id) override
 
void getObjectsInsideRadius (const v3f &pos, float radius, std::vector< ServerActiveObject * > &result, std::function< bool(ServerActiveObject *obj)> include_obj_cb)
 
void getObjectsInArea (const aabb3f &box, std::vector< ServerActiveObject * > &result, std::function< bool(ServerActiveObject *obj)> include_obj_cb)
 
void getAddedActiveObjectsAroundPos (const v3f &player_pos, f32 radius, f32 player_radius, std::set< u16 > &current_objects, std::queue< u16 > &added_objects)
 
- Public Member Functions inherited from ActiveObjectMgr< ServerActiveObject >
ServerActiveObjectgetActiveObject (u16 id)
 

Additional Inherited Members

- Protected Member Functions inherited from ActiveObjectMgr< ServerActiveObject >
u16 getFreeId () const
 
bool isFreeId (u16 id) const
 
- Protected Attributes inherited from ActiveObjectMgr< ServerActiveObject >
std::unordered_map< u16, ServerActiveObject * > m_active_objects
 

Member Function Documentation

◆ clear()

void ActiveObjectMgr< T >::clear ( const std::function< bool(ServerActiveObject *, u16)> &  cb)

References ActiveObjectMgr< ServerActiveObject >::m_active_objects.

Referenced by ServerEnvironment::clearObjects(), clearSAOMgr(), ServerEnvironment::deactivateFarObjects(), and ServerEnvironment::removeRemovedObjects().

+ Here is the caller graph for this function:

◆ getAddedActiveObjectsAroundPos()

void ActiveObjectMgr< T >::getAddedActiveObjectsAroundPos ( const v3f player_pos,
f32  radius,
f32  player_radius,
std::set< u16 > &  current_objects,
std::queue< u16 > &  added_objects 
)

References ACTIVEOBJECT_TYPE_PLAYER, ServerActiveObject::getBasePosition(), ActiveObject::getType(), ServerActiveObject::isGone(), and ActiveObjectMgr< ServerActiveObject >::m_active_objects.

Referenced by ServerEnvironment::getAddedActiveObjects(), and TestServerActiveObjectMgr::testGetAddedActiveObjectsAroundPos().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectsInArea()

void ActiveObjectMgr< T >::getObjectsInArea ( const aabb3f box,
std::vector< ServerActiveObject * > &  result,
std::function< bool(ServerActiveObject *obj)>  include_obj_cb 
)

References ServerActiveObject::getBasePosition(), and ActiveObjectMgr< ServerActiveObject >::m_active_objects.

Referenced by ServerEnvironment::getObjectsInArea().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectsInsideRadius()

void ActiveObjectMgr< T >::getObjectsInsideRadius ( const v3f pos,
float  radius,
std::vector< ServerActiveObject * > &  result,
std::function< bool(ServerActiveObject *obj)>  include_obj_cb 
)

References ServerActiveObject::getBasePosition(), and ActiveObjectMgr< ServerActiveObject >::m_active_objects.

Referenced by ServerEnvironment::getObjectsInsideRadius(), and TestServerActiveObjectMgr::testGetObjectsInsideRadius().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerObject()

◆ removeObject()

void ActiveObjectMgr< T >::removeObject ( u16  id)
overridevirtual

Implements ActiveObjectMgr< ServerActiveObject >.

References ActiveObjectMgr< ServerActiveObject >::getActiveObject(), infostream, ActiveObjectMgr< ServerActiveObject >::m_active_objects, and verbosestream.

Referenced by TestServerActiveObjectMgr::testRemoveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ step()

void ActiveObjectMgr< T >::step ( float  dtime,
const std::function< void(ServerActiveObject *)> &  f 
)
overridevirtual

Implements ActiveObjectMgr< ServerActiveObject >.

References Profiler::avg(), g_profiler, and ActiveObjectMgr< ServerActiveObject >::m_active_objects.

Referenced by ServerEnvironment::step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: