A typed view into a buffer view that contains raw binary data.
More...
#include <CesiumGltf/Accessor.h>
|
int32_t | bufferView = -1 |
| The index of the bufferView. More...
|
|
int64_t | byteOffset = 0 |
| The offset relative to the start of the buffer view in bytes. More...
|
|
int32_t | componentType = ComponentType::BYTE |
| The datatype of the accessor's components. More...
|
|
bool | normalized = false |
| Specifies whether integer data values are normalized before usage. More...
|
|
int64_t | count = int64_t() |
| The number of elements referenced by this accessor. More...
|
|
std::string | type = Type::SCALAR |
| Specifies if the accessor's elements are scalars, vectors, or matrices. More...
|
|
std::vector< double > | max |
| Maximum value of each component in this accessor. More...
|
|
std::vector< double > | min |
| Minimum value of each component in this accessor. More...
|
|
std::optional< CesiumGltf::AccessorSparse > | sparse |
| Sparse storage of elements that deviate from their initialization value.
|
|
std::string | name |
| The user-defined name of this object. More...
|
|
std::unordered_map< std::string, std::any > | extensions |
| The extensions attached to this object. More...
|
|
JsonValue::Object | extras |
| Application-specific data. More...
|
|
JsonValue::Object | unknownProperties |
| Unknown properties that exist on this object but do not have any representation in the statically-typed classes. More...
|
|
static constexpr const char * | TypeName = "Accessor" |
|
A typed view into a buffer view that contains raw binary data.
Definition at line 12 of file Accessor.h.
◆ computeByteSizeOfComponent() [1/2]
int8_t CesiumGltf::Accessor::computeByteSizeOfComponent |
( |
| ) |
const |
|
noexcept |
Computes the number of bytes for this accessor's component type.
For example if this accessor's Accessor::componentType is CesiumGltf::Accessor::ComponentType::UNSIGNED_SHORT
, then the component type is 2 bytes, while if it's CesiumGltf::Accessor::ComponentType::FLOAT
then it is 4 bytes.
- Returns
- The number of bytes for this accessor's component type. Returns 0 if this accessor's Accessor::componentType does not have a valid enumeration value.
◆ computeByteSizeOfComponent() [2/2]
static int8_t CesiumGltf::Accessor::computeByteSizeOfComponent |
( |
int32_t |
componentType | ) |
|
|
staticnoexcept |
Computes the number of bytes for a given accessor component type.
For example CesiumGltf::Accessor::ComponentType::UNSIGNED_SHORT
is 2 bytes while CesiumGltf::Accessor::ComponentType::FLOAT
is 4 bytes.
- Parameters
-
componentType | The accessor component type. |
- Returns
- The number of bytes for the component type. Returns 0 if Accessor::componentType is not a valid enumeration value.
◆ computeBytesPerVertex()
int64_t CesiumGltf::Accessor::computeBytesPerVertex |
( |
| ) |
const |
|
noexcept |
◆ computeByteStride()
int64_t CesiumGltf::Accessor::computeByteStride |
( |
const CesiumGltf::Model & |
model | ) |
const |
|
noexcept |
Computes this accessor's stride.
The stride is the number of bytes between the same elements of successive vertices. The returned value will be at least as large as Accessor::computeBytesPerVertex, but maybe be larger if this accessor's data is interleaved with other accessors.
The behavior is undefined if this accessor is not part of the given model.
- Parameters
-
model | The model that this accessor is a part of. |
- Returns
- The stride in bytes. Returns 0 if this accessor's Accessor::type or Accessor::componentType does not have a valid enumeration value, or if Accessor::bufferView does not refer to a valid BufferView.
◆ computeNumberOfComponents() [1/2]
int8_t CesiumGltf::Accessor::computeNumberOfComponents |
( |
| ) |
const |
|
noexcept |
Computes the number of components for this accessor.
For example if this accessor's Accessor::type is CesiumGltf::Accessor::Type::SCALAR
, then it has 1 component, while if it's CesiumGltf::Accessor::Type::VEC4
it has 4 components.
- Returns
- The number of components in this accessor. Returns 0 if this accessor's Accessor::type does not have a valid enumeration value.
◆ computeNumberOfComponents() [2/2]
static int8_t CesiumGltf::Accessor::computeNumberOfComponents |
( |
const std::string & |
type | ) |
|
|
staticnoexcept |
Computes the number of components for a given accessor type.
For example CesiumGltf::Accessor::Type::SCALAR
has 1 component while CesiumGltf::Accessor::Type::VEC4
has 4 components.
- Parameters
-
- Returns
- The number of components. Returns 0 if Accessor::type is not a valid enumeration value.
The documentation for this struct was generated from the following file:
- /home/runner/work/cesium-native/cesium-native/CesiumGltf/include/CesiumGltf/Accessor.h