AssimpIO Class

(Qt3DRender::AssimpIO)

提供将各种3D资产格式加载到Qt3D场景中的通用方法。More...

Header: #include <AssimpIO>
qmake: QT += 3drender
Since: Qt 5.5

Public Functions

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

Detailed Description

提供将各种3D资产格式加载到Qt3D场景中的通用方法。

应该指出的是,Assimp aiString被明确定义为UTF-8。

See also GLTFPIO.

Member Function Documentation

AssimpIO::AssimpIO()

Constructor. Initializes a new instance of AssimpIO.

AssimpIO::~AssimpIO()

Destructor. Cleans the parser properly before destroying it.

bool AssimpIO::isFileTypeSupported(const QUrl &source) const

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

Qt3DCore::QEntity *AssimpIO::node(const QString &id)

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

Qt3DCore::QEntity *AssimpIO::scene(const QString &id = QString())

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.

void AssimpIO::setSource(const QUrl &source)

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