cesium-native
0.41.0
|
Writes glTF. More...
#include <CesiumGltfWriter/GltfWriter.h>
Public Member Functions | |
GltfWriter () | |
Constructs a new instance. | |
CesiumJsonWriter::ExtensionWriterContext & | getExtensions () |
Gets the context used to control how glTF extensions are written. | |
const CesiumJsonWriter::ExtensionWriterContext & | getExtensions () const |
Gets the context used to control how glTF extensions are written. | |
GltfWriterResult | writeGltf (const CesiumGltf::Model &model, const GltfWriterOptions &options=GltfWriterOptions()) const |
Serializes the provided model into a glTF JSON byte vector. More... | |
GltfWriterResult | writeGlb (const CesiumGltf::Model &model, const gsl::span< const std::byte > &bufferData, const GltfWriterOptions &options=GltfWriterOptions()) const |
Serializes the provided model into a glb byte vector. More... | |
Writes glTF.
Definition at line 57 of file GltfWriter.h.
GltfWriterResult CesiumGltfWriter::GltfWriter::writeGlb | ( | const CesiumGltf::Model & | model, |
const gsl::span< const std::byte > & | bufferData, | ||
const GltfWriterOptions & | options = GltfWriterOptions() |
||
) | const |
Serializes the provided model into a glb byte vector.
The first buffer object implicitly refers to the GLB binary chunk and should not have a uri. Ignores internal data such as CesiumGltf::BufferCesium and CesiumGltf::ImageAsset.
model | The model. |
bufferData | The buffer data to store in the GLB binary chunk. |
options | Options for how to write the glb. |
GltfWriterResult CesiumGltfWriter::GltfWriter::writeGltf | ( | const CesiumGltf::Model & | model, |
const GltfWriterOptions & | options = GltfWriterOptions() |
||
) | const |
Serializes the provided model into a glTF JSON byte vector.
Ignores internal data such as CesiumGltf::BufferCesium and CesiumGltf::ImageAsset when serializing the glTF. Internal data must either be converted to data uris or saved as external files. The buffer.uri and image.uri fields must be set accordingly prior to calling this function.
model | The model. |
options | Options for how to write the glTF. |