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;
35 static constexpr int32_t
SHORT = 5122;
41 static constexpr int32_t
INT = 5124;
47 static constexpr int32_t
INT64 = 5134;
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";
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() -
202 friend struct Accessor;
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.
static constexpr int32_t DOUBLE
DOUBLE (5130)
static constexpr int32_t INT
INT (5124)
static constexpr int32_t UNSIGNED_SHORT
UNSIGNED_SHORT (5123)
static constexpr int32_t UNSIGNED_INT
UNSIGNED_INT (5125)
static constexpr int32_t UNSIGNED_BYTE
UNSIGNED_BYTE (5121)
static constexpr int32_t SHORT
SHORT (5122)
static constexpr int32_t UNSIGNED_INT64
UNSIGNED_INT64 (5135)
static constexpr int32_t INT64
INT64 (5134)
static constexpr int32_t BYTE
BYTE (5120)
static constexpr int32_t FLOAT
FLOAT (5126)
Known values for Specifies if the accessor's elements are scalars, vectors, or matrices.
static const std::string SCALAR
SCALAR
static const std::string VEC4
VEC4
static const std::string MAT4
MAT4
static const std::string VEC3
VEC3
static const std::string MAT3
MAT3
static const std::string VEC2
VEC2
static const std::string MAT2
MAT2
int64_t byteOffset
The offset relative to the start of the buffer view in bytes.
std::optional< CesiumGltf::AccessorSparse > sparse
Sparse storage of elements that deviate from their initialization value.
bool normalized
Specifies whether integer data values are normalized before usage.
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::string type
Specifies if the accessor's elements are scalars, vectors, or matrices.
std::vector< double > min
Minimum value of each component in this accessor.
int64_t count
The number of elements referenced by this accessor.
int32_t componentType
The datatype of the accessor's components.
static constexpr const char * TypeName
The original name of this type.
std::vector< double > max
Maximum value of each component in this accessor.
int32_t bufferView
The index of the bufferView.
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,...