Irrlicht 3D Engine
irr::scene::ISceneNodeFactory Class Referenceabstract

Interface for dynamic creation of scene nodes. More...

#include <ISceneNodeFactory.h>

+ Inheritance diagram for irr::scene::ISceneNodeFactory:

Public Member Functions

virtual ISceneNodeaddSceneNode (ESCENE_NODE_TYPE type, ISceneNode *parent=0)=0
 adds a scene node to the scene graph based on its type id More...
 
virtual ISceneNodeaddSceneNode (const c8 *typeName, ISceneNode *parent=0)=0
 adds a scene node to the scene graph based on its type name More...
 
virtual u32 getCreatableSceneNodeTypeCount () const =0
 returns amount of scene node types this factory is able to create More...
 
virtual ESCENE_NODE_TYPE getCreateableSceneNodeType (u32 idx) const =0
 returns type of a creatable scene node type More...
 
virtual const c8getCreateableSceneNodeTypeName (u32 idx) const =0
 returns type name of a creatable scene node type by index More...
 
virtual const c8getCreateableSceneNodeTypeName (ESCENE_NODE_TYPE type) const =0
 returns type name of a creatable scene node type More...
 
- Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor. More...
 
virtual ~IReferenceCounted ()
 Destructor. More...
 
bool drop () const
 Drops the object. Decrements the reference counter by one. More...
 
const c8getDebugName () const
 Returns the debug name of the object. More...
 
s32 getReferenceCount () const
 Get the reference count. More...
 
void grab () const
 Grabs the object. Increments the reference counter by one. More...
 

Additional Inherited Members

- Protected Member Functions inherited from irr::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object. More...
 

Detailed Description

Interface for dynamic creation of scene nodes.

To be able to add custom scene nodes to Irrlicht and to make it possible for the scene manager to save and load those external scene nodes, simply implement this interface and register it in you scene manager via ISceneManager::registerSceneNodeFactory. Note: When implementing your own scene node factory, don't call ISceneNodeManager::grab() to increase the reference counter of the scene node manager. This is not necessary because the scene node manager will grab() the factory anyway, and otherwise cyclic references will be created and the scene manager and all its nodes won't get deallocated.

Definition at line 27 of file ISceneNodeFactory.h.

Member Function Documentation

◆ addSceneNode() [1/2]

virtual ISceneNode* irr::scene::ISceneNodeFactory::addSceneNode ( ESCENE_NODE_TYPE  type,
ISceneNode parent = 0 
)
pure virtual

adds a scene node to the scene graph based on its type id

Parameters
typeType of the scene node to add.
parentParent scene node of the new node, can be null to add the scene node to the root.
Returns
Returns pointer to the new scene node or null if not successful. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ addSceneNode() [2/2]

virtual ISceneNode* irr::scene::ISceneNodeFactory::addSceneNode ( const c8 typeName,
ISceneNode parent = 0 
)
pure virtual

adds a scene node to the scene graph based on its type name

Parameters
typeNameType name of the scene node to add.
parentParent scene node of the new node, can be null to add the scene node to the root.
Returns
Returns pointer to the new scene node or null if not successful. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ getCreatableSceneNodeTypeCount()

virtual u32 irr::scene::ISceneNodeFactory::getCreatableSceneNodeTypeCount ( ) const
pure virtual

returns amount of scene node types this factory is able to create

◆ getCreateableSceneNodeType()

virtual ESCENE_NODE_TYPE irr::scene::ISceneNodeFactory::getCreateableSceneNodeType ( u32  idx) const
pure virtual

returns type of a creatable scene node type

Parameters
idxIndex of scene node type in this factory. Must be a value between 0 and getCreatableSceneNodeTypeCount()

◆ getCreateableSceneNodeTypeName() [1/2]

virtual const c8* irr::scene::ISceneNodeFactory::getCreateableSceneNodeTypeName ( u32  idx) const
pure virtual

returns type name of a creatable scene node type by index

Parameters
idxIndex of scene node type in this factory. Must be a value between 0 and getCreatableSceneNodeTypeCount()

◆ getCreateableSceneNodeTypeName() [2/2]

virtual const c8* irr::scene::ISceneNodeFactory::getCreateableSceneNodeTypeName ( ESCENE_NODE_TYPE  type) const
pure virtual

returns type name of a creatable scene node type

Parameters
typeType of scene node.
Returns
: Returns name of scene node type if this factory can create the type, otherwise 0.

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