diff --git a/docs/spec/sequential.decoder.md b/docs/spec/sequential.decoder.md index 2209387..5ba0677 100644 --- a/docs/spec/sequential.decoder.md +++ b/docs/spec/sequential.decoder.md @@ -55,11 +55,10 @@ void ParseSequentialIndicesUI32() { {:.draco-syntax } -### DecodeSequentialConnectivityData() +### DecodeSequentialIndices() ~~~~~ -void DecodeSequentialConnectivityData() { - ParseSequentialConnectivityData(); +void DecodeSequentialIndices() { if (num_points < 256) { ParseSequentialIndicesUI8(); } else if (num_points < (1 << 16)) { @@ -70,3 +69,40 @@ void DecodeSequentialConnectivityData() { } ~~~~~ {:.draco-syntax } + + +### DecodeSequentialCompressedIndices() + +~~~~~ +void DecodeSequentialCompressedIndices() { + DecodeSymbols(num_faces * 3, 1, &decoded_symbols); + last_index_value = 0; + for (i = 0; i < num_faces; ++i) { + for (j = 0; j < 3; ++j) { + encoded_val = decoded_symbols[i * 3 + j]; + index_diff = (encoded_val >> 1); + if (encoded_val & 1) + index_diff = -index_diff; + val = index_diff + last_index_value; + face_to_vertex[j][i] = val; + last_index_value = val; + } + } +} +~~~~~ +{:.draco-syntax } + + +### DecodeSequentialConnectivityData() + +~~~~~ +void DecodeSequentialConnectivityData() { + ParseSequentialConnectivityData(); + if (connectivity_method == 0) { + DecodeSequentialCompressedIndices(); + } else if (connectivity_method == 1) { + DecodeSequentialIndices(); + } +} +~~~~~ +{:.draco-syntax }