AssimpImporter Class

(Qt3DRender::AssimpImporter)

Provides a generic way of loading various 3D assets format into a Qt3D scene. More...

Header: #include <AssimpImporter>
qmake: QT += 3drender
Since: Qt 5.5
Inherits: Qt3DRender::QSceneImporter

Public Functions

Reimplemented Public Functions

virtual bool isFileTypeSupported(const QUrl &source) const
virtual Qt3DCore::QEntity *node(const QString &id)
virtual Qt3DCore::QEntity *scene(const QString &id = QString())
virtual void setSource(const QUrl &source)

Additional Inherited Members

Detailed Description

Provides a generic way of loading various 3D assets format into a Qt3D scene.

It should be noted that Assimp aiString is explicitly defined to be UTF-8.

Member Function Documentation

AssimpImporter::AssimpImporter()

Constructor. Initializes a new instance of AssimpImporter.

AssimpImporter::~AssimpImporter()

Destructor. Cleans the parser properly before destroying it.

[virtual] bool AssimpImporter::isFileTypeSupported(const QUrl &source) const

Reimplemented from QSceneImporter::isFileTypeSupported().

Returns true if the extension of source is supported by the assimp parser.

[virtual] Qt3DCore::QEntity *AssimpImporter::node(const QString &id)

Reimplemented from QSceneImporter::node().

Returns a Node from the scene identified by id. Returns nullptr if the node was not found.

[virtual] Qt3DCore::QEntity *AssimpImporter::scene(const QString &id = QString())

Reimplemented from QSceneImporter::scene().

Returns a Entity node which is the root node of the scene node specified by id. If id is empty, the scene is assumed to be the root node of the scene.

Returns nullptr if id was specified but no node matching it was found.

[virtual] void AssimpImporter::setSource(const QUrl &source)

Reimplemented from QSceneImporter::setSource().

Sets the source used by the parser to load the asset file. If the file is valid, this will trigger parsing of the file.