cesium-native
0.41.0
|
Reads glTF models and images. More...
#include <CesiumGltfReader/GltfReader.h>
Public Member Functions | |
GltfReader () | |
Constructs a new instance. | |
CesiumJsonReader::JsonReaderOptions & | getOptions () |
Gets the options controlling how the JSON is read. | |
const CesiumJsonReader::JsonReaderOptions & | getExtensions () const |
Gets the options controlling how the JSON is read. | |
GltfReaderResult | readGltf (const gsl::span< const std::byte > &data, const GltfReaderOptions &options=GltfReaderOptions()) const |
Reads a glTF or binary glTF (GLB) from a buffer. More... | |
CesiumAsync::Future< GltfReaderResult > | loadGltf (const CesiumAsync::AsyncSystem &asyncSystem, const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &headers, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const GltfReaderOptions &options=GltfReaderOptions()) const |
Reads a glTF or binary glTF file from a URL and resolves external buffers and images. More... | |
void | postprocessGltf (GltfReaderResult &readGltf, const GltfReaderOptions &options) |
Performs post-load processing on a glTF. The specific operations performed are controlled by the provided options . More... | |
Static Public Member Functions | |
static CesiumAsync::Future< GltfReaderResult > | resolveExternalData (CesiumAsync::AsyncSystem asyncSystem, const std::string &baseUrl, const CesiumAsync::HttpHeaders &headers, std::shared_ptr< CesiumAsync::IAssetAccessor > pAssetAccessor, const GltfReaderOptions &options, GltfReaderResult &&result) |
Accepts the result of readGltf and resolves any remaining external buffers and images. More... | |
static ImageReaderResult | readImage (const gsl::span< const std::byte > &data, const CesiumGltf::Ktx2TranscodeTargets &ktx2TranscodeTargets) |
Reads an Image from a buffer. More... | |
static std::optional< std::string > | generateMipMaps (CesiumGltf::ImageAsset &image) |
Generate mipmaps for this image. More... | |
Reads glTF models and images.
Definition at line 124 of file GltfReader.h.
|
static |
Generate mipmaps for this image.
CesiumAsync::Future<GltfReaderResult> CesiumGltfReader::GltfReader::loadGltf | ( | const CesiumAsync::AsyncSystem & | asyncSystem, |
const std::string & | url, | ||
const std::vector< CesiumAsync::IAssetAccessor::THeader > & | headers, | ||
const std::shared_ptr< CesiumAsync::IAssetAccessor > & | pAssetAccessor, | ||
const GltfReaderOptions & | options = GltfReaderOptions() |
||
) | const |
Reads a glTF or binary glTF file from a URL and resolves external buffers and images.
asyncSystem | The async system to use for resolving external data. |
url | The url for reading the file. |
headers | http headers needed to make the request. |
pAssetAccessor | The asset accessor to use to make the necessary requests. |
options | Options for how to read the glTF. |
void CesiumGltfReader::GltfReader::postprocessGltf | ( | GltfReaderResult & | readGltf, |
const GltfReaderOptions & | options | ||
) |
Performs post-load processing on a glTF. The specific operations performed are controlled by the provided options
.
readGltf | The result of reading the glTF. |
options | The options to use in post-processing. |
GltfReaderResult CesiumGltfReader::GltfReader::readGltf | ( | const gsl::span< const std::byte > & | data, |
const GltfReaderOptions & | options = GltfReaderOptions() |
||
) | const |
Reads a glTF or binary glTF (GLB) from a buffer.
data | The buffer from which to read the glTF. |
options | Options for how to read the glTF. |
|
static |
Reads an Image from a buffer.
|
static |
Accepts the result of readGltf and resolves any remaining external buffers and images.
asyncSystem | The async system to use for resolving external data. |
baseUrl | The base url that all the external uris are relative to. |
headers | The http headers needed to make any external data requests. |
pAssetAccessor | The asset accessor to use to request the external buffers and images. |
options | Options for how to read the glTF. |
result | The result of the synchronous readGltf invocation. |