arsa  2.7
Public Member Functions | Protected Attributes | List of all members
irr::scene::IMeshLoader Class Referenceabstract

Class which is able to load an animated mesh from a file. More...

#include <IMeshLoader.h>

Inheritance diagram for irr::scene::IMeshLoader:
irr::IReferenceCounted

Public Member Functions

 IMeshLoader ()
 Constructor. More...
 
virtual ~IMeshLoader ()
 Destructor. More...
 
virtual bool isALoadableFileExtension (const io::path &filename) const =0
 Returns true if the file might be loaded by this class. More...
 
virtual IAnimatedMeshcreateMesh (io::IReadFile *file)=0
 Creates/loads an animated mesh from the file. More...
 
virtual void setMeshTextureLoader (IMeshTextureLoader *textureLoader)
 Set a new texture loader which this meshloader can use when searching for textures. More...
 
virtual IMeshTextureLoadergetMeshTextureLoader () const
 Get the texture loader used when this meshloader searches for textures. More...
 
- Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor. More...
 
virtual ~IReferenceCounted ()
 Destructor. More...
 
void grab () const
 Grabs the object. Increments the reference counter by one. More...
 
bool drop () const
 Drops the object. Decrements the reference counter by one. More...
 
s32 getReferenceCount () const
 Get the reference count. More...
 
const c8getDebugName () const
 Returns the debug name of the object. More...
 

Protected Attributes

IMeshTextureLoaderTextureLoader
 

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

Class which is able to load an animated mesh from a file.

If you want Irrlicht be able to load meshes of currently unsupported file formats (e.g. .cob), then implement this and add your new Meshloader with ISceneManager::addExternalMeshLoader() to the engine.

Definition at line 27 of file IMeshLoader.h.

Constructor & Destructor Documentation

◆ IMeshLoader()

irr::scene::IMeshLoader::IMeshLoader ( )
inline

Constructor.

Definition at line 32 of file IMeshLoader.h.

32 : TextureLoader(0) {}
IMeshTextureLoader * TextureLoader
Definition: IMeshLoader.h:82

◆ ~IMeshLoader()

virtual irr::scene::IMeshLoader::~IMeshLoader ( )
inlinevirtual

Destructor.

Definition at line 35 of file IMeshLoader.h.

36  {
37  if ( TextureLoader )
39  }
bool drop() const
Drops the object. Decrements the reference counter by one.
IMeshTextureLoader * TextureLoader
Definition: IMeshLoader.h:82

Member Function Documentation

◆ createMesh()

virtual IAnimatedMesh* irr::scene::IMeshLoader::createMesh ( io::IReadFile file)
pure virtual

Creates/loads an animated mesh from the file.

Parameters
fileFile handler to load the file from.
Returns
Pointer to the created mesh. Returns 0 if loading failed. If you no longer need the mesh, you should call IAnimatedMesh::drop(). See IReferenceCounted::drop() for more information.

◆ getMeshTextureLoader()

virtual IMeshTextureLoader* irr::scene::IMeshLoader::getMeshTextureLoader ( ) const
inlinevirtual

Get the texture loader used when this meshloader searches for textures.

NOTE: not all meshloaders support this interface so this can return NULL.

Definition at line 76 of file IMeshLoader.h.

77  {
78  return TextureLoader;
79  }
IMeshTextureLoader * TextureLoader
Definition: IMeshLoader.h:82

◆ isALoadableFileExtension()

virtual bool irr::scene::IMeshLoader::isALoadableFileExtension ( const io::path filename) const
pure virtual

Returns true if the file might be loaded by this class.

This decision should be based on the file extension (e.g. ".cob") only.

Parameters
filenameName of the file to test.
Returns
True if the file might be loaded by this class.

◆ setMeshTextureLoader()

virtual void irr::scene::IMeshLoader::setMeshTextureLoader ( IMeshTextureLoader textureLoader)
inlinevirtual

Set a new texture loader which this meshloader can use when searching for textures.

NOTE: Not all meshloaders do support this interface. Meshloaders which support it will return a non-null value in getMeshTextureLoader from the start. Setting a texture-loader to a meshloader which doesn't support it won't help.

Parameters
textureLoaderThe textureloader to use. When set to NULL the mesh will not load any textures.

Definition at line 61 of file IMeshLoader.h.

62  {
63  if ( textureLoader != TextureLoader )
64  {
65  if ( textureLoader )
66  textureLoader->grab();
67  if ( TextureLoader )
69  TextureLoader = textureLoader;
70  }
71  }
bool drop() const
Drops the object. Decrements the reference counter by one.
IMeshTextureLoader * TextureLoader
Definition: IMeshLoader.h:82

Member Data Documentation

◆ TextureLoader

IMeshTextureLoader* irr::scene::IMeshLoader::TextureLoader
protected

Definition at line 82 of file IMeshLoader.h.


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