Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::scene::ISceneLoader Class Referenceabstract

Class which can load a scene into the scene manager. More...

#include <nirtcpp/core/engine/ISceneLoader.hpp>

Inheritance diagram for nirt::scene::ISceneLoader:
Inheritance graph
Collaboration diagram for nirt::scene::ISceneLoader:
Collaboration graph

Public Member Functions

virtual bool isALoadableFileExtension (const io::path &filename) const =0
 Returns true if the class might be able to load this file.
 
virtual bool isALoadableFileFormat (io::IReadFile *file) const =0
 Returns true if the class might be able to load this file.
 
virtual bool loadScene (io::IReadFile *file, ISceneUserDataSerializer *userDataSerializer=0, ISceneNode *rootNode=0)=0
 Loads the scene into the scene manager.
 
- Public Member Functions inherited from nirt::IReferenceCounted
 IReferenceCounted ()
 Constructor.
 
virtual ~IReferenceCounted ()
 Destructor.
 
void grab () const
 Grabs the object. Increments the reference counter by one.
 
bool drop () const
 Drops the object. Decrements the reference counter by one.
 
s32 getReferenceCount () const
 Get the reference count.
 
const c8getDebugName () const
 Returns the debug name of the object.
 

Additional Inherited Members

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

Detailed Description

Class which can load a scene into the scene manager.

If you want Nirtcpp to be able to load currently unsupported scene file formats (e.g. .vrml), then implement this and add your new Sceneloader to the engine with ISceneManager::addExternalSceneLoader().

Member Function Documentation

◆ isALoadableFileExtension()

virtual bool nirt::scene::ISceneLoader::isALoadableFileExtension ( const io::path filename) const
pure virtual

Returns true if the class might be able to load this file.

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

Parameters
filenameName of the file to test.
Returns
True if the extension is a recognised type.

◆ isALoadableFileFormat()

virtual bool nirt::scene::ISceneLoader::isALoadableFileFormat ( io::IReadFile file) const
pure virtual

Returns true if the class might be able to load this file.

This decision will be based on a quick look at the contents of the file.

Parameters
fileThe file to test.
Returns
True if the extension is a recognised type.

◆ loadScene()

virtual bool nirt::scene::ISceneLoader::loadScene ( io::IReadFile file,
ISceneUserDataSerializer userDataSerializer = 0,
ISceneNode rootNode = 0 
)
pure virtual

Loads the scene into the scene manager.

Parameters
fileFile which contains the scene.
userDataSerializerIf you want to load user data which may be attached to some some scene nodes in the file, implement the ISceneUserDataSerializer interface and provide it as parameter here. Otherwise, simply specify 0 as this parameter.
rootNodeThe node to load the scene into, if none is provided then the scene will be loaded into the root node.
Returns
Returns true on success, false on failure. Returns 0 if loading failed.

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

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print