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

Method computeNumberOfComponents

CesiumGltf/src/Accessor.cpp:9–34  ·  view source on GitHub ↗

static*/

Source from the content-addressed store, hash-verified

7
8namespace CesiumGltf {
9/*static*/ int8_t
10Accessor::computeNumberOfComponents(const std::string& type) noexcept {
11 if (type == CesiumGltf::Accessor::Type::SCALAR) {
12 return 1;
13 }
14 if (type == CesiumGltf::Accessor::Type::VEC2) {
15 return 2;
16 }
17 if (type == CesiumGltf::Accessor::Type::VEC3) {
18 return 3;
19 }
20 if (type == CesiumGltf::Accessor::Type::VEC4) {
21 return 4;
22 }
23 if (type == CesiumGltf::Accessor::Type::MAT2) {
24 return 4;
25 }
26 if (type == CesiumGltf::Accessor::Type::MAT3) {
27 return 9;
28 }
29 if (type == CesiumGltf::Accessor::Type::MAT4) {
30 return 16;
31 }
32 // TODO Print a warning here!
33 return 0;
34}
35
36/*static*/ int8_t
37Accessor::computeByteSizeOfComponent(int32_t componentType) noexcept {

Callers 6

computeBytesPerVertexMethod · 0.95
dequantizeAccessorFunction · 0.80
copyDecodedAttributeFunction · 0.80
createMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected