Minetest  5.4.0
ClientActiveObject Class Reference

#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)
 
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 scene::ISceneNode * getSceneNode () const
 
virtual scene::IAnimatedMeshSceneNode * getAnimatedMeshSceneNode () const
 
virtual bool isLocalPlayer () const
 
virtual ClientActiveObjectgetParent () const
 
virtual const std::unordered_set< int > & 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 (u16 id)
 
u16 getId () const
 
void setId (u16 id)
 
virtual ActiveObjectType getType () const =0
 
virtual void setAttachment (int parent_id, const std::string &bone, v3f position, v3f rotation, bool force_visible)
 
virtual void getAttachment (int *parent_id, std::string *bone, v3f *position, v3f *rotation, bool *force_visible) const
 
virtual void clearChildAttachments ()
 
virtual void clearParentAttachment ()
 
virtual void addAttachmentChild (int child_id)
 
virtual void removeAttachmentChild (int child_id)
 

Static Public Member Functions

static ClientActiveObjectcreate (ActiveObjectType type, Client *client, ClientEnvironment *env)
 

Protected Types

typedef 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
u16 m_id
 

Static Private Attributes

static std::unordered_map< u16, Factorym_types
 

Member Typedef Documentation

◆ Factory

typedef 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)
inlinevirtual

Reimplemented in GenericCAO, and TestCAO.

◆ collideWithObjects()

virtual bool ClientActiveObject::collideWithObjects ( ) const
inlinevirtual

Implements ActiveObject.

Reimplemented in GenericCAO.

◆ create()

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<int>& ClientActiveObject::getAttachmentChildIds ( ) const
inlinevirtual

Reimplemented in GenericCAO.

Referenced by ClientEnvironment::addActiveObject().

+ Here is the caller graph for this function:

◆ 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.

Referenced by client::ActiveObjectMgr::getActiveObjects(), 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 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.

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

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

Referenced by ClientEnvironment::addActiveObject().

+ Here is the caller graph for this function:

◆ 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(), and client::ActiveObjectMgr::removeObject().

+ 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: