3#include "CesiumGltf/PropertyType.h"
5#include <CesiumUtility/Assert.h>
6#include <CesiumUtility/SpanHelper.h>
12static size_t getOffsetFromOffsetsBuffer(
14 const std::span<const std::byte>& offsetBuffer,
18 CESIUM_ASSERT(index < offsetBuffer.size() /
sizeof(uint8_t));
19 const uint8_t offset = *
reinterpret_cast<const uint8_t*
>(
20 offsetBuffer.data() + index *
sizeof(uint8_t));
21 return static_cast<size_t>(offset);
24 CESIUM_ASSERT(index < offsetBuffer.size() /
sizeof(uint16_t));
25 const uint16_t offset = *
reinterpret_cast<const uint16_t*
>(
26 offsetBuffer.data() + index *
sizeof(uint16_t));
27 return static_cast<size_t>(offset);
30 CESIUM_ASSERT(index < offsetBuffer.size() /
sizeof(uint32_t));
31 const uint32_t offset = *
reinterpret_cast<const uint32_t*
>(
32 offsetBuffer.data() + index *
sizeof(uint32_t));
33 return static_cast<size_t>(offset);
36 CESIUM_ASSERT(index < offsetBuffer.size() /
sizeof(uint64_t));
37 const uint64_t offset = *
reinterpret_cast<const uint64_t*
>(
38 offsetBuffer.data() + index *
sizeof(uint64_t));
39 return static_cast<size_t>(offset);
42 CESIUM_ASSERT(
false &&
"Offset type is invalid");
Classes for working with glTF models.
PropertyComponentType
The possible types of a property component.
@ Uint32
A property component equivalent to a uint32_t.
@ Uint16
A property component equivalent to a uint16_t.
@ Uint8
A property component equivalent to a uint8_t.
@ Uint64
A property component equivalent to a uint32_t.