| 82 | } |
| 83 | |
| 84 | CesiumGltf::Accessor* findAccessor( |
| 85 | GltfReaderResult& readGltf, |
| 86 | CesiumGltf::MeshPrimitive& primitive, |
| 87 | const std::string& attributeName) { |
| 88 | const std::unordered_map<std::string, int32_t>::iterator attributeIt = |
| 89 | primitive.attributes.find(attributeName); |
| 90 | if (attributeIt == primitive.attributes.end()) { |
| 91 | readGltf.warnings.emplace_back( |
| 92 | "Failed to find " + attributeName + |
| 93 | " attribute on KHR_gaussian_splatting_compression_spz_2 primitive"); |
| 94 | return nullptr; |
| 95 | } |
| 96 | |
| 97 | CESIUM_ASSERT(readGltf.model); |
| 98 | |
| 99 | CesiumGltf::Accessor* pAccessor = CesiumGltf::Model::getSafe( |
| 100 | &readGltf.model->accessors, |
| 101 | attributeIt->second); |
| 102 | if (!pAccessor) { |
| 103 | readGltf.warnings.emplace_back( |
| 104 | "Failed to find accessor at index " + |
| 105 | std::to_string(attributeIt->second)); |
| 106 | return nullptr; |
| 107 | } |
| 108 | |
| 109 | return pAccessor; |
| 110 | } |
| 111 | |
| 112 | void copyShCoeff( |
| 113 | GltfReaderResult& readGltf, |
no test coverage detected