MCPcopy Create free account
hub / github.com/CesiumGS/cesium-native / dequantizeMeshData

Function dequantizeMeshData

CesiumGltfReader/src/dequantizeMeshData.cpp:172–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170} // namespace
171
172void dequantizeMeshData(Model& model) {
173 for (Mesh& mesh : model.meshes) {
174 for (MeshPrimitive& primitive : mesh.primitives) {
175 for (const std::pair<const std::string, int32_t>& attribute :
176 primitive.attributes) {
177 Accessor* pAccessor =
178 Model::getSafe(&model.accessors, attribute.second);
179 if (!pAccessor) {
180 continue;
181 }
182 if (pAccessor->componentType == Accessor::ComponentType::FLOAT) {
183 continue;
184 }
185 const std::string& attributeName = attribute.first;
186 if (attributeName == "POSITION" || attributeName == "NORMAL" ||
187 attributeName == "TANGENT" ||
188 attributeName.starts_with("TEXCOORD")) {
189 dequantizeAccessor(model, *pAccessor);
190 }
191 }
192 }
193 }
194
195 model.removeExtensionRequired("KHR_mesh_quantization");
196}
197} // namespace CesiumGltfReader

Callers 1

postprocessFunction · 0.85

Calls 3

getSafeFunction · 0.85
dequantizeAccessorFunction · 0.85

Tested by

no test coverage detected