// This file was generated by generate-classes. // DO NOT EDIT THIS FILE! #pragma once #include #include #include #include #include #include #include #include namespace CesiumGltf { /** * @brief Parameters describing an implicit shape. */ struct CESIUMGLTF_API Shape final : public CesiumGltf::NamedObject { /** * @brief The original name of this type. */ static constexpr const char* TypeName = "Shape"; /** * @brief Known values for Specifies the shape type. */ struct Type { /** @brief A sphere with a specified radius, centered at the origin in local * space. */ inline static const std::string sphere = "sphere"; /** @brief An axis-aligned box with a size per-axis, centered at the origin * in local space */ inline static const std::string box = "box"; /** @brief A capsule shape, centered at the origin in local space, * equivalent to the convex hull of two spheres located along the Y axis (in * local space) at a specified distance. */ inline static const std::string capsule = "capsule"; /** @brief A cylinder shape, centered at the origin in local space, * equivalent to the convex hull of two circles in the X/Z plane positioned * along the Y axis at a specified distance. */ inline static const std::string cylinder = "cylinder"; }; /** * @brief Specifies the shape type. * * Known values are defined in {@link Type}. * */ std::string type = Type::sphere; /** * @brief A set of parameter values that are used to define a sphere shape. */ std::optional sphere; /** * @brief A set of parameter values that are used to define a box shape. */ std::optional box; /** * @brief A set of parameter values that are used to define a capsule shape. */ std::optional capsule; /** * @brief A set of parameter values that are used to define a cylinder shape. */ std::optional cylinder; /** * @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(Shape)); accum += CesiumGltf::NamedObject::getSizeBytes() - int64_t(sizeof(CesiumGltf::NamedObject)); if (this->sphere) { accum += this->sphere->getSizeBytes() - int64_t(sizeof(CesiumGltf::Sphere)); } if (this->box) { accum += this->box->getSizeBytes() - int64_t(sizeof(CesiumGltf::Box)); } if (this->capsule) { accum += this->capsule->getSizeBytes() - int64_t(sizeof(CesiumGltf::Capsule)); } if (this->cylinder) { accum += this->cylinder->getSizeBytes() - int64_t(sizeof(CesiumGltf::Cylinder)); } return accum; } }; } // namespace CesiumGltf