MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / GetNumComponentsInType

Function GetNumComponentsInType

external/tinygltf/tiny_gltf.h:228–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228static inline int32_t GetNumComponentsInType(uint32_t ty) {
229 if (ty == TINYGLTF_TYPE_SCALAR) {
230 return 1;
231 } else if (ty == TINYGLTF_TYPE_VEC2) {
232 return 2;
233 } else if (ty == TINYGLTF_TYPE_VEC3) {
234 return 3;
235 } else if (ty == TINYGLTF_TYPE_VEC4) {
236 return 4;
237 } else if (ty == TINYGLTF_TYPE_MAT2) {
238 return 4;
239 } else if (ty == TINYGLTF_TYPE_MAT3) {
240 return 9;
241 } else if (ty == TINYGLTF_TYPE_MAT4) {
242 return 16;
243 } else {
244 // Unknown component type
245 return -1;
246 }
247}
248
249// TODO(syoyo): Move these functions to TinyGLTF class
250bool IsDataURI(const std::string &in);

Callers 1

ByteStrideMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected