Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QSSGGltfParser Class Reference

#include <qssggltfparser_p.h>

Collaboration diagram for QSSGGltfParser:

Public Member Functions

bool parse (const QByteArray &data, const QString &baseDir, QSSGGltfDocument *document)
bool parseFile (const QString &filePath, QSSGGltfDocument *document)
QString errorMessage () const

Static Public Member Functions

static QStringList supportedExtensions ()

Detailed Description

Parses glTF 2.0 content (.gltf JSON or binary .glb container) into a QSSGGltfDocument. Buffers (external files, data: URIs, and the GLB BIN chunk) are resolved eagerly; image contents are left unresolved.

Validation is two-tier: structural violations (out-of-range indices, accessors extending past their buffer view, truncated GLB, unsupported required extensions) fail the parse with an error message; tolerable deviations from the specification are logged as warnings and clamped, repaired, or ignored, matching the leniency of other glTF consumers. A node with more than one parent and a scene root that is not unique both fall in the second group: the offending edge is dropped, because the node hierarchy has to be a forest for consumers to recurse over it safely, but the rest of the asset is still worth loading.

Definition at line 27 of file qssggltfparser_p.h.

Member Function Documentation

◆ errorMessage()

QString QSSGGltfParser::errorMessage ( ) const
inline

Definition at line 35 of file qssggltfparser_p.h.

◆ parse()

bool QSSGGltfParser::parse ( const QByteArray & data,
const QString & baseDir,
QSSGGltfDocument * document )

Parses .gltf JSON or a .glb container in data into document. baseDir is the local or qrc directory used to resolve relative buffer and image URIs.

Definition at line 189 of file qssggltfparser.cpp.

◆ parseFile()

bool QSSGGltfParser::parseFile ( const QString & filePath,
QSSGGltfDocument * document )

Convenience overload of parse() reading filePath, a local file or qrc path, into document.

Definition at line 174 of file qssggltfparser.cpp.

◆ supportedExtensions()

QStringList QSSGGltfParser::supportedExtensions ( )
static

Returns the extensions the parser understands. Assets that list anything else in extensionsRequired fail to parse.

Being on this list means the extension is represented in QSSGGltfDocument, not that any particular consumer acts on it: a consumer that ignores one of these still gets a document it can load.

Definition at line 138 of file qssggltfparser.cpp.


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