Luanti 5.16.0-dev
Loading...
Searching...
No Matches
server::ActiveObjectMgr Class Referencefinal

#include <activeobjectmgr.h>

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

Public Member Functions

 ~ActiveObjectMgr () override
void clearIf (const std::function< bool(ServerActiveObject *, u16)> &cb)
void step (float dtime, const std::function< void(ServerActiveObject *)> &f) override
bool registerObject (std::unique_ptr< ServerActiveObject > obj) override
void removeObject (u16 id) override
void invalidateActiveObjectObserverCaches ()
void updateObjectPos (u16 id, v3f pos)
void getObjectsInsideRadius (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 (v3f player_pos, const std::string &player_name, f32 radius, f32 player_radius, const std::set< u16 > &current_objects, std::vector< u16 > &added_objects)
Public Member Functions inherited from ActiveObjectMgr< ServerActiveObject >
 ActiveObjectMgr ()=default
 DISABLE_CLASS_COPY (ActiveObjectMgr)
void clear ()
ServerActiveObjectgetActiveObject (u16 id)

Private Attributes

k_d_tree::DynamicKdTrees< 3, f32, u16 > m_spatial_index

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ~ActiveObjectMgr()

ActiveObjectMgr< T >::~ActiveObjectMgr ( )
overridevirtual

Reimplemented from ActiveObjectMgr< ServerActiveObject >.

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

Here is the call graph for this function:

Member Function Documentation

◆ clearIf()

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

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

Here is the call graph for this function:

◆ getAddedActiveObjectsAroundPos()

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

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

Referenced by TEST_CASE().

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 _, and m_spatial_index.

Referenced by benchGetObjectsInArea().

Here is the caller graph for this function:

◆ getObjectsInsideRadius()

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

References ActiveObjectMgr< ServerActiveObject >::m_active_objects, and m_spatial_index.

Referenced by benchGetObjectsInsideRadius(), and TEST_CASE().

Here is the caller graph for this function:

◆ invalidateActiveObjectObserverCaches()

void ActiveObjectMgr< T >::invalidateActiveObjectObserverCaches ( )

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

Here is the call graph for this function:

◆ registerObject()

bool ActiveObjectMgr< T >::registerObject ( std::unique_ptr< ServerActiveObject > obj)
overridevirtual

Implements ActiveObjectMgr< ServerActiveObject >.

References errorstream, ActiveObjectMgr< ServerActiveObject >::getFreeId(), ActiveObjectMgr< ServerActiveObject >::isFreeId(), ActiveObjectMgr< ServerActiveObject >::m_active_objects, m_spatial_index, objectpos_over_limit(), verbosestream, and warningstream.

Referenced by TEST_CASE().

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

◆ removeObject()

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

Implements ActiveObjectMgr< ServerActiveObject >.

References infostream, ActiveObjectMgr< ServerActiveObject >::m_active_objects, m_spatial_index, and verbosestream.

Referenced by clearIf().

Here is the caller graph for this function:

◆ step()

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

◆ updateObjectPos()

void ActiveObjectMgr< T >::updateObjectPos ( u16 id,
v3f pos )

Member Data Documentation

◆ m_spatial_index

k_d_tree::DynamicKdTrees<3, f32, u16> server::ActiveObjectMgr::m_spatial_index
private

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