cesium-native  0.41.0
CesiumGltfWriter::GltfWriter Class Reference

Writes glTF. More...

#include <CesiumGltfWriter/GltfWriter.h>

Public Member Functions

 GltfWriter ()
 Constructs a new instance.
 
CesiumJsonWriter::ExtensionWriterContextgetExtensions ()
 Gets the context used to control how glTF extensions are written.
 
const CesiumJsonWriter::ExtensionWriterContextgetExtensions () 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...
 

Detailed Description

Writes glTF.

Definition at line 57 of file GltfWriter.h.

Member Function Documentation

◆ writeGlb()

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.

Parameters
modelThe model.
bufferDataThe buffer data to store in the GLB binary chunk.
optionsOptions for how to write the glb.
Returns
The result of writing the glb.

◆ writeGltf()

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.

Parameters
modelThe model.
optionsOptions for how to write the glTF.
Returns
The result of writing the glTF.

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