Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
client::ActiveObjectMgr Class Referencefinal

#include <activeobjectmgr.h>

+ Inheritance diagram for client::ActiveObjectMgr:
+ Collaboration diagram for client::ActiveObjectMgr:

Public Member Functions

 ~ActiveObjectMgr () override
 
void step (float dtime, const std::function< void(ClientActiveObject *)> &f) override
 
bool registerObject (std::unique_ptr< ClientActiveObject > obj) override
 
void removeObject (u16 id) override
 
void getActiveObjects (const v3f &origin, f32 max_d, std::vector< DistanceSortedActiveObject > &dest)
 
std::vector< DistanceSortedActiveObjectgetActiveSelectableObjects (const core::line3d< f32 > &shootline)
 Gets all CAOs whose selection boxes may intersect the shootline.
 
- Public Member Functions inherited from ActiveObjectMgr< ClientActiveObject >
 ActiveObjectMgr ()=default
 
 DISABLE_CLASS_COPY (ActiveObjectMgr)
 
void clear ()
 
ClientActiveObjectgetActiveObject (u16 id)
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ~ActiveObjectMgr()

ActiveObjectMgr< T >::~ActiveObjectMgr ( )
overridevirtual

Reimplemented from ActiveObjectMgr< ClientActiveObject >.

References ActiveObjectMgr< ClientActiveObject >::clear(), ModifySafeMap< K, V >::empty(), ActiveObjectMgr< ClientActiveObject >::m_active_objects, and warningstream.

+ Here is the call graph for this function:

Member Function Documentation

◆ getActiveObjects()

void ActiveObjectMgr< T >::getActiveObjects ( const v3f & origin,
f32 max_d,
std::vector< DistanceSortedActiveObject > & dest )

References ClientActiveObject::getPosition(), ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ClientActiveObject >::m_active_objects.

Referenced by ClientEnvironment::getActiveObjects().

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

◆ getActiveSelectableObjects()

std::vector< DistanceSortedActiveObject > ActiveObjectMgr< T >::getActiveSelectableObjects ( const core::line3d< f32 > & shootline)

Gets all CAOs whose selection boxes may intersect the shootline.

Note
CAOs without a selection box are not returned.
Distances are along the shootline.

References dir(), ClientActiveObject::getPosition(), ClientActiveObject::getSelectionBox(), ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ClientActiveObject >::m_active_objects.

Referenced by ClientEnvironment::getSelectedActiveObjects(), and TestClientActiveObjectMgr::testGetActiveSelectableObjects().

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

◆ registerObject()

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

Implements ActiveObjectMgr< ClientActiveObject >.

References ActiveObjectMgr< ClientActiveObject >::getFreeId(), infostream, ActiveObjectMgr< ClientActiveObject >::isFreeId(), ActiveObjectMgr< ClientActiveObject >::m_active_objects, and ModifySafeMap< K, V >::put().

Referenced by ClientEnvironment::addActiveObject(), register_default_test_object(), and TestClientActiveObjectMgr::testGetActiveSelectableObjects().

+ 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< ClientActiveObject >.

References infostream, ActiveObjectMgr< ClientActiveObject >::m_active_objects, ModifySafeMap< K, V >::take(), and verbosestream.

Referenced by ClientEnvironment::removeActiveObject(), and TEST_CASE().

+ 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(ClientActiveObject *)> & f )
overridevirtual

Implements ActiveObjectMgr< ClientActiveObject >.

References Profiler::avg(), g_profiler, ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ClientActiveObject >::m_active_objects.

Referenced by ClientEnvironment::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: