std::vector ReadBinaryData()

in GLTFSDK/Inc/GLTFSDK/GLTFResourceReader.h [70:111]


            std::vector<T> ReadBinaryData(const Document& gltfDocument, const Accessor& accessor) const
            {
                bool isValid;

                switch (accessor.componentType)
                {
                case COMPONENT_BYTE:
                    isValid = std::is_same<T, int8_t>::value;
                    break;
                case COMPONENT_UNSIGNED_BYTE:
                    isValid = std::is_same<T, uint8_t>::value;
                    break;
                case COMPONENT_SHORT:
                    isValid = std::is_same<T, int16_t>::value;
                    break;
                case COMPONENT_UNSIGNED_SHORT:
                    isValid = std::is_same<T, uint16_t>::value;
                    break;
                case COMPONENT_UNSIGNED_INT:
                    isValid = std::is_same<T, uint32_t>::value;
                    break;
                case COMPONENT_FLOAT:
                    isValid = std::is_same<T, float>::value;
                    break;
                default:
                    throw GLTFException("Unsupported accessor ComponentType");
                }

                if (!isValid)
                {
                    throw GLTFException("ReadAccessorData: Template type T does not match accessor ComponentType");
                }

                Validation::ValidateAccessor(gltfDocument, accessor);

                if (accessor.sparse.count > 0U)
                {
                    return ReadSparseAccessor<T>(gltfDocument, accessor);
                }

                return ReadAccessor<T>(gltfDocument, accessor);
            }