#include <activeobjectmgr.h>
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< DistanceSortedActiveObject > | getActiveSelectableObjects (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 () |
ClientActiveObject * | getActiveObject (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 |
|
overridevirtual |
Reimplemented from ActiveObjectMgr< ClientActiveObject >.
References ActiveObjectMgr< ClientActiveObject >::clear(), ModifySafeMap< K, V >::empty(), ActiveObjectMgr< ClientActiveObject >::m_active_objects, and warningstream.
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().
std::vector< DistanceSortedActiveObject > ActiveObjectMgr< T >::getActiveSelectableObjects | ( | const core::line3d< f32 > & | shootline | ) |
Gets all CAOs whose selection boxes may intersect the shootline
.
shootline
. References dir(), ClientActiveObject::getPosition(), ClientActiveObject::getSelectionBox(), ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ClientActiveObject >::m_active_objects.
Referenced by ClientEnvironment::getSelectedActiveObjects(), and TestClientActiveObjectMgr::testGetActiveSelectableObjects().
|
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().
|
overridevirtual |
Implements ActiveObjectMgr< ClientActiveObject >.
References infostream, ActiveObjectMgr< ClientActiveObject >::m_active_objects, ModifySafeMap< K, V >::take(), and verbosestream.
Referenced by ClientEnvironment::removeActiveObject(), and TEST_CASE().
|
overridevirtual |
Implements ActiveObjectMgr< ClientActiveObject >.
References Profiler::avg(), g_profiler, ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ClientActiveObject >::m_active_objects.
Referenced by ClientEnvironment::step().