[+] Use "buffer" ID against "bufferView" ID for Open3DGC-compression.

pull/972/head
Alexandr Arutjunov 2016-08-09 13:37:32 +03:00
parent 9a4fa1321b
commit 778ad7f06f
3 changed files with 3 additions and 3 deletions

View File

@ -736,7 +736,7 @@ namespace glTF
{ {
using SExtension::Type; using SExtension::Type;
std::string BufferView;///< Name of "bufferView" used for storing compressed data. std::string Buffer;///< ID of "buffer" used for storing compressed data.
size_t Offset;///< Offset in "bufferView" where compressed data are stored. size_t Offset;///< Offset in "bufferView" where compressed data are stored.
size_t Count;///< Count of elements in compressed data. Is always equivalent to size in bytes: look comments for "Type" and "Component_Type". size_t Count;///< Count of elements in compressed data. Is always equivalent to size in bytes: look comments for "Type" and "Component_Type".
size_t IndicesCount;///< Count of indices in mesh. size_t IndicesCount;///< Count of indices in mesh.

View File

@ -219,7 +219,7 @@ namespace glTF {
// filling object "compressedData" // filling object "compressedData"
json_comp_data.SetObject(); json_comp_data.SetObject();
json_comp_data.AddMember("bufferView", ptr_ext_comp->BufferView, w.mAl); json_comp_data.AddMember("buffer", ptr_ext_comp->Buffer, w.mAl);
json_comp_data.AddMember("byteOffset", ptr_ext_comp->Offset, w.mAl); json_comp_data.AddMember("byteOffset", ptr_ext_comp->Offset, w.mAl);
json_comp_data.AddMember("componentType", 5121, w.mAl); json_comp_data.AddMember("componentType", 5121, w.mAl);
json_comp_data.AddMember("type", "SCALAR", w.mAl); json_comp_data.AddMember("type", "SCALAR", w.mAl);

View File

@ -426,7 +426,7 @@ bool comp_allow;// Point that data of current mesh can be compressed.
Mesh::SCompression_Open3DGC* ext = new Mesh::SCompression_Open3DGC; Mesh::SCompression_Open3DGC* ext = new Mesh::SCompression_Open3DGC;
// Fill it. // Fill it.
ext->BufferView = p.indices->bufferView->id; ext->Buffer = b->id;
ext->Offset = idx_srcdata_begin; ext->Offset = idx_srcdata_begin;
ext->Count = b->byteLength - idx_srcdata_begin; ext->Count = b->byteLength - idx_srcdata_begin;
ext->IndicesCount = comp_o3dgc_ifs.GetNCoordIndex(); ext->IndicesCount = comp_o3dgc_ifs.GetNCoordIndex();