// This file was generated by generate-classes. // DO NOT EDIT THIS FILE! #pragma once #include #include #include #include #include namespace CesiumGltf { /** * @brief glTF extension defines instance attributes for a node with a mesh. */ struct CESIUMGLTF_API ExtensionExtMeshGpuInstancing final : public CesiumUtility::ExtensibleObject { /** * @brief The original name of this type. */ static constexpr const char* TypeName = "ExtensionExtMeshGpuInstancing"; /** @brief The official name of the extension. This should be the same as its * key in the `extensions` object. */ static constexpr const char* ExtensionName = "EXT_mesh_gpu_instancing"; /** * @brief A dictionary object, where each key corresponds to instance * attribute and each value is the index of the accessor containing * attribute's data. Attributes TRANSLATION, ROTATION, SCALE define instance * transformation. For "TRANSLATION" the values are FLOAT_VEC3's specifying * translation along the x, y, and z axes. For "ROTATION" the values are * VEC4's specifying rotation as a quaternion in the order (x, y, z, w), where * w is the scalar, with component type `FLOAT` or normalized integer. For * "SCALE" the values are FLOAT_VEC3's specifying scaling factors along the x, * y, and z axes. */ std::unordered_map attributes; /** * @brief Calculates the size in bytes of this object, including the contents * of all collections, pointers, and strings. This will NOT include the size * of any extensions attached to the object. Calling this method may be slow * as it requires traversing the object's entire structure. */ int64_t getSizeBytes() const { int64_t accum = 0; accum += int64_t(sizeof(ExtensionExtMeshGpuInstancing)); accum += CesiumUtility::ExtensibleObject::getSizeBytes() - int64_t(sizeof(CesiumUtility::ExtensibleObject)); accum += int64_t( this->attributes.bucket_count() * (sizeof(std::string) + sizeof(int32_t))); for (const auto& [k, v] : this->attributes) { accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string)); accum += int64_t(sizeof(int32_t)); } return accum; } }; } // namespace CesiumGltf