From 8c5f1989a476595626bf8d929b287ade95c6f704 Mon Sep 17 00:00:00 2001 From: sean Date: Mon, 23 Oct 2023 19:14:03 +0200 Subject: [PATCH] Fix: Update docs example code --- docs/overview.rst | 9 +++++---- docs/tools.rst | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/overview.rst b/docs/overview.rst index 26d04e7da..9bca80ad0 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -122,8 +122,8 @@ The following snippet illustrates how to use fastgltf to load a glTF file. .. code:: c++ - #include - #include + #include + #include void load(std::filesystem::path path) { // Creates a Parser instance. Optimally, you should reuse this across loads, but don't use it @@ -139,6 +139,7 @@ The following snippet illustrates how to use fastgltf to load a glTF file. // This loads the glTF file into the gltf object and parses the JSON. For GLB files, use // Parser::loadBinaryGLTF instead. + // You can detect the type of glTF using fastgltf::determineGltfFileType. auto asset = parser.loadGLTF(&data, path.parent_path(), fastgltf::Options::None); if (auto error = asset.error(); error != fastgltf::Error::None) { // Some error occurred while reading the buffer, parsing the JSON, or validating the data. @@ -151,11 +152,11 @@ The following snippet illustrates how to use fastgltf to load a glTF file. // Process the buffers. } - // Optionally, you can now also call the Parser::validate method. This will more strictly + // Optionally, you can now also call the fastgltf::validate method. This will more strictly // enforce the glTF spec and is not needed most of the time, though I would certainly // recommend it in a development environment or when debugging to avoid mishaps. - // parser.validate(asset.get()); + // fastgltf::validate(asset.get()); } diff --git a/docs/tools.rst b/docs/tools.rst index be27747ff..5a3b24c45 100644 --- a/docs/tools.rst +++ b/docs/tools.rst @@ -21,6 +21,9 @@ For example, ``glm::vec3`` would be a vector of 3 floats, which would be defined template <> struct fastgltf::ElementTraits : fastgltf::ElementTraitsBase {}; +Note that, for glm types, there is a header with all pre-defined types shipped with fastgltf: ``fastgltf/glm_element_traits.hpp``. +This header includes the ElementTraits definition for all relevant glm types. + .. warning::