Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
ClientActiveObject Class Referenceabstract

#include <clientobject.h>

+ Inheritance diagram for ClientActiveObject:
+ Collaboration diagram for ClientActiveObject:

Public Member Functions

 ClientActiveObject (u16 id, Client *client, ClientEnvironment *env)
 
virtual ~ClientActiveObject ()
 
virtual void addToScene (ITextureSource *tsrc, scene::ISceneManager *smgr)=0
 
virtual void removeFromScene (bool permanent)
 
virtual void updateLight (u32 day_night_ratio)
 
virtual bool getCollisionBox (aabb3f *toset) const
 
virtual bool getSelectionBox (aabb3f *toset) const
 
virtual bool collideWithObjects () const
 
virtual const v3f getPosition () const
 
virtual const v3f getVelocity () const
 
virtual scene::ISceneNode * getSceneNode () const
 
virtual scene::IAnimatedMeshSceneNode * getAnimatedMeshSceneNode () const
 
virtual bool isLocalPlayer () const
 
virtual ClientActiveObjectgetParent () const
 
virtual const std::unordered_set< object_t > & getAttachmentChildIds () const
 
virtual void updateAttachments ()
 
virtual bool doShowSelectionBox ()
 
virtual void step (float dtime, ClientEnvironment *env)
 
virtual void processMessage (const std::string &data)
 
virtual std::string infoText ()
 
virtual std::string debugInfoText ()
 
virtual void initialize (const std::string &data)
 
virtual bool directReportPunch (v3f dir, const ItemStack *punchitem=nullptr, float time_from_last_punch=1000000)
 
- Public Member Functions inherited from ActiveObject
 ActiveObject (object_t id)
 
object_t getId () const
 
void setId (object_t id)
 
virtual ActiveObjectType getType () const =0
 
virtual void setAttachment (object_t parent_id, const std::string &bone, v3f position, v3f rotation, bool force_visible)
 
virtual void getAttachment (object_t *parent_id, std::string *bone, v3f *position, v3f *rotation, bool *force_visible) const
 
virtual void clearChildAttachments ()
 
virtual void clearParentAttachment ()
 
virtual void addAttachmentChild (object_t child_id)
 
virtual void removeAttachmentChild (object_t child_id)
 

Static Public Member Functions

static std::unique_ptr< ClientActiveObjectcreate (ActiveObjectType type, Client *client, ClientEnvironment *env)
 

Protected Types

typedef std::unique_ptr< ClientActiveObject >(* Factory) (Client *client, ClientEnvironment *env)
 

Static Protected Member Functions

static void registerType (u16 type, Factory f)
 

Protected Attributes

Clientm_client
 
ClientEnvironmentm_env
 
- Protected Attributes inherited from ActiveObject
object_t m_id
 

Static Private Attributes

static std::unordered_map< u16, Factorym_types
 

Additional Inherited Members

- Public Types inherited from ActiveObject
typedef u16 object_t
 

Member Typedef Documentation

◆ Factory

typedef std::unique_ptr< ClientActiveObject >(* ClientActiveObject::Factory) (Client *client, ClientEnvironment *env)
protected

Constructor & Destructor Documentation

◆ ClientActiveObject()

ClientActiveObject::ClientActiveObject ( u16 id,
Client * client,
ClientEnvironment * env )

◆ ~ClientActiveObject()

ClientActiveObject::~ClientActiveObject ( )
virtual

References removeFromScene().

+ Here is the call graph for this function:

Member Function Documentation

◆ addToScene()

virtual void ClientActiveObject::addToScene ( ITextureSource * tsrc,
scene::ISceneManager * smgr )
pure virtual

Implemented in GenericCAO, TestCAO, TestClientActiveObject, and TestSelectableClientActiveObject.

Referenced by ClientEnvironment::addActiveObject().

+ Here is the caller graph for this function:

◆ collideWithObjects()

virtual bool ClientActiveObject::collideWithObjects ( ) const
inlinevirtual

Implements ActiveObject.

Reimplemented in GenericCAO.

◆ create()

std::unique_ptr< ClientActiveObject > ClientActiveObject::create ( ActiveObjectType type,
Client * client,
ClientEnvironment * env )
static

References m_types, and warningstream.

Referenced by ClientEnvironment::addActiveObject().

+ Here is the caller graph for this function:

◆ debugInfoText()

virtual std::string ClientActiveObject::debugInfoText ( )
inlinevirtual

Reimplemented in GenericCAO.

Referenced by Game::handlePointingAtObject().

+ Here is the caller graph for this function:

◆ directReportPunch()

virtual bool ClientActiveObject::directReportPunch ( v3f dir,
const ItemStack * punchitem = nullptr,
float time_from_last_punch = 1000000 )
inlinevirtual

Reimplemented in GenericCAO.

Referenced by Game::handlePointingAtObject().

+ Here is the caller graph for this function:

◆ doShowSelectionBox()

virtual bool ClientActiveObject::doShowSelectionBox ( )
inlinevirtual

Referenced by Game::updatePointedThing().

+ Here is the caller graph for this function:

◆ getAnimatedMeshSceneNode()

virtual scene::IAnimatedMeshSceneNode * ClientActiveObject::getAnimatedMeshSceneNode ( ) const
inlinevirtual

Reimplemented in GenericCAO.

Referenced by GenericCAO::updateAttachments().

+ Here is the caller graph for this function:

◆ getAttachmentChildIds()

virtual const std::unordered_set< object_t > & ClientActiveObject::getAttachmentChildIds ( ) const
inlinevirtual

Reimplemented in GenericCAO.

◆ getCollisionBox()

virtual bool ClientActiveObject::getCollisionBox ( aabb3f * toset) const
inlinevirtual

Returns the collision box of the object. This box is translated by the object's location. The box's coordinates are world coordinates.

Returns
true if the object has a collision box.

Implements ActiveObject.

Reimplemented in GenericCAO, and TestCAO.

◆ getParent()

virtual ClientActiveObject * ClientActiveObject::getParent ( ) const
inlinevirtual

Reimplemented in GenericCAO.

◆ getPosition()

virtual const v3f ClientActiveObject::getPosition ( ) const
inlinevirtual

Reimplemented in GenericCAO, and TestSelectableClientActiveObject.

Referenced by client::ActiveObjectMgr::getActiveObjects(), client::ActiveObjectMgr::getActiveSelectableObjects(), ClientEnvironment::getSelectedActiveObjects(), Client::handleCommand_PlaySound(), Game::handlePointingAtObject(), Client::step(), Camera::update(), and Game::updatePointedThing().

+ Here is the caller graph for this function:

◆ getSceneNode()

virtual scene::ISceneNode * ClientActiveObject::getSceneNode ( ) const
inlinevirtual

Reimplemented in GenericCAO.

Referenced by ClientEnvironment::getSelectedActiveObjects(), GenericCAO::step(), and GenericCAO::updateAttachments().

+ Here is the caller graph for this function:

◆ getSelectionBox()

virtual bool ClientActiveObject::getSelectionBox ( aabb3f * toset) const
inlinevirtual

Returns the selection box of the object. This box is not translated when the object moves. The box's coordinates are world coordinates.

Returns
true if the object has a selection box.

Implements ActiveObject.

Reimplemented in GenericCAO, and TestSelectableClientActiveObject.

Referenced by client::ActiveObjectMgr::getActiveSelectableObjects(), ClientEnvironment::getSelectedActiveObjects(), and Game::updatePointedThing().

+ Here is the caller graph for this function:

◆ getVelocity()

virtual const v3f ClientActiveObject::getVelocity ( ) const
inlinevirtual

Reimplemented in GenericCAO.

Referenced by Client::handleCommand_PlaySound(), Client::step(), and Game::updateSound().

+ Here is the caller graph for this function:

◆ infoText()

virtual std::string ClientActiveObject::infoText ( )
inlinevirtual

Reimplemented in GenericCAO.

Referenced by Game::handlePointingAtObject().

+ Here is the caller graph for this function:

◆ initialize()

virtual void ClientActiveObject::initialize ( const std::string & data)
inlinevirtual

Reimplemented in GenericCAO.

◆ isLocalPlayer()

virtual bool ClientActiveObject::isLocalPlayer ( ) const
inlinevirtual

Reimplemented in GenericCAO.

Referenced by GenericCAO::updateAttachments().

+ Here is the caller graph for this function:

◆ processMessage()

virtual void ClientActiveObject::processMessage ( const std::string & data)
inlinevirtual

Reimplemented in GenericCAO, and TestCAO.

Referenced by ClientEnvironment::processActiveObjectMessage().

+ Here is the caller graph for this function:

◆ registerType()

void ClientActiveObject::registerType ( u16 type,
Factory f )
staticprotected

References m_types.

Referenced by GenericCAO::GenericCAO(), and TestCAO::TestCAO().

+ Here is the caller graph for this function:

◆ removeFromScene()

virtual void ClientActiveObject::removeFromScene ( bool permanent)
inlinevirtual

Reimplemented in GenericCAO, and TestCAO.

Referenced by ~ClientActiveObject().

+ Here is the caller graph for this function:

◆ step()

virtual void ClientActiveObject::step ( float dtime,
ClientEnvironment * env )
inlinevirtual

Reimplemented in GenericCAO, and TestCAO.

◆ updateAttachments()

virtual void ClientActiveObject::updateAttachments ( )
inlinevirtual

Reimplemented in GenericCAO.

Referenced by GenericCAO::step(), and GenericCAO::updateAttachments().

+ Here is the caller graph for this function:

◆ updateLight()

virtual void ClientActiveObject::updateLight ( u32 day_night_ratio)
inlinevirtual

Reimplemented in GenericCAO, and TestCAO.

Member Data Documentation

◆ m_client

Client* ClientActiveObject::m_client
protected

◆ m_env

◆ m_types

std::unordered_map< u16, ClientActiveObject::Factory > ClientActiveObject::m_types
staticprivate

Referenced by create(), and registerType().


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