MCPcopy Create free account
hub / github.com/KhronosGroup/COLLADA2GLTF / writeJSON

Method writeJSON

GLTF/src/GLTFBufferView.cpp:26–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void GLTF::BufferView::writeJSON(void* writer, GLTF::Options* options) {
27 rapidjson::Writer<rapidjson::StringBuffer>* jsonWriter = (rapidjson::Writer<rapidjson::StringBuffer>*)writer;
28 if (this->buffer) {
29 jsonWriter->Key("buffer");
30 if (options->version == "1.0") {
31 jsonWriter->String(buffer->getStringId().c_str());
32 }
33 else {
34 jsonWriter->Int(this->buffer->id);
35 }
36 }
37 jsonWriter->Key("byteOffset");
38 jsonWriter->Int(this->byteOffset);
39 jsonWriter->Key("byteLength");
40 jsonWriter->Int(this->byteLength);
41 if (byteStride != 0 && options->version != "1.0") {
42 jsonWriter->Key("byteStride");
43 jsonWriter->Int(this->byteStride);
44 }
45 if ((int)target > 0) {
46 jsonWriter->Key("target");
47 jsonWriter->Int((int)this->target);
48 }
49}

Callers

nothing calls this directly

Calls 1

getStringIdMethod · 0.80

Tested by

no test coverage detected