5#include <CesiumGltf/AccessorSparse.h>
6#include <CesiumGltf/Library.h>
7#include <CesiumGltf/NamedObject.h>
22 static constexpr const char* TypeName =
"Accessor";
29 static constexpr int32_t BYTE = 5120;
32 static constexpr int32_t UNSIGNED_BYTE = 5121;
35 static constexpr int32_t SHORT = 5122;
38 static constexpr int32_t UNSIGNED_SHORT = 5123;
41 static constexpr int32_t INT = 5124;
44 static constexpr int32_t UNSIGNED_INT = 5125;
47 static constexpr int32_t INT64 = 5134;
50 static constexpr int32_t UNSIGNED_INT64 = 5135;
53 static constexpr int32_t FLOAT = 5126;
56 static constexpr int32_t DOUBLE = 5130;
65 inline static const std::string SCALAR =
"SCALAR";
68 inline static const std::string VEC2 =
"VEC2";
71 inline static const std::string VEC3 =
"VEC3";
74 inline static const std::string VEC4 =
"VEC4";
77 inline static const std::string MAT2 =
"MAT2";
80 inline static const std::string MAT3 =
"MAT3";
83 inline static const std::string MAT4 =
"MAT4";
93 int32_t bufferView = -1;
101 int64_t byteOffset = 0;
112 int32_t componentType = ComponentType::BYTE;
122 bool normalized =
false;
130 int64_t count = int64_t();
139 std::string type = Type::SCALAR;
175 std::optional<CesiumGltf::AccessorSparse>
sparse;
188 accum += int64_t(
sizeof(
double) * this->max.capacity());
189 accum += int64_t(
sizeof(
double) * this->min.capacity());
191 accum += this->sparse->getSizeBytes() -
Classes for working with glTF models.
Sparse storage of accessor values that deviate from their initialization value.
Known values for The datatype of the accessor's components.
Known values for Specifies if the accessor's elements are scalars, vectors, or matrices.
A typed view into a buffer view that contains raw binary data.
std::optional< CesiumGltf::AccessorSparse > sparse
Sparse storage of elements that deviate from their initialization value.
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
AccessorSpec()=default
This class is not meant to be instantiated directly. Use Accessor instead.
std::vector< double > min
Minimum value of each component in this accessor.
std::vector< double > max
Maximum value of each component in this accessor.
This class is not meant to be instantiated directly. Use Accessor instead.
The base class for objects in a glTF that have a name.
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...