static*/
| 7 | |
| 8 | namespace CesiumGltf { |
| 9 | /*static*/ int8_t |
| 10 | Accessor::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 |
| 37 | Accessor::computeByteSizeOfComponent(int32_t componentType) noexcept { |
no outgoing calls
no test coverage detected