3#include <CesiumGeospatial/BoundingRegion.h>
4#include <CesiumGeospatial/Ellipsoid.h>
5#include <CesiumGeospatial/GlobeRectangle.h>
6#include <CesiumGltfContent/Library.h>
42 static std::optional<glm::dmat4x4>
72 const glm::dmat4x4& rootTransform);
94 const glm::dmat4x4& rootTransform);
116 const glm::dmat4& transform,
129 static std::vector<std::string_view>
139 static std::vector<std::string_view>
180 const std::vector<int32_t>& extraUsedTextureIndices = {});
192 const std::vector<int32_t>& extraUsedSamplerIndices = {});
204 const std::vector<int32_t>& extraUsedImageIndices = {});
216 const std::vector<int32_t>& extraUsedAccessorIndices = {});
228 const std::vector<int32_t>& extraUsedBufferViewIndices = {});
240 const std::vector<int32_t>& extraUsedBufferIndices = {});
252 const std::vector<int32_t>& extraUsedMeshIndices = {});
264 const std::vector<int32_t>& extraUsedMaterialIndices = {});
290 glm::dvec3 primitivePoint = {};
295 glm::dmat4x4 primitiveToWorld = {};
300 glm::dvec3 worldPoint = {};
305 double rayToWorldPointDistanceSq = -1.0;
315 int32_t primitiveId = -1;
325 std::optional<RayGltfHit>
hit;
330 std::vector<std::string> warnings{};
350 bool cullBackFaces =
true,
351 const glm::dmat4x4& gltfTransform = glm::dmat4(1.0));
A ray that extends infinitely from the provided origin in the provided direction.
A bounding volume specified as a longitude/latitude bounding box and a minimum and maximum height.
A quadratic surface defined in Cartesian coordinates.
Basic geometry classes for Cesium.
Classes that support manipulating the content of a glTF.
Classes for working with glTF models.
Hit result data for intersectRayGltfModel.
std::optional< RayGltfHit > hit
Optional hit result, if an intersection occurred.
Data describing a hit from a ray / gltf intersection test.
static std::vector< std::string_view > parseGltfCopyright(const std::string_view &s)
Parse a semicolon-separated string, such as the copyright field of a glTF model, and return the indiv...
static void compactBuffers(CesiumGltf::Model &gltf)
Shrink buffers by removing any sections that are not referenced by any BufferView.
static void removeUnusedSamplers(CesiumGltf::Model &gltf, const std::vector< int32_t > &extraUsedSamplerIndices={})
Removes unused samplers from the given glTF model.
static void removeUnusedBufferViews(CesiumGltf::Model &gltf, const std::vector< int32_t > &extraUsedBufferViewIndices={})
Removes unused buffer views from the given glTF model.
static glm::dmat4x4 applyRtcCenter(const CesiumGltf::Model &gltf, const glm::dmat4x4 &rootTransform)
Applies the glTF's RTC_CENTER, if any, to the given transform.
static IntersectResult intersectRayGltfModel(const CesiumGeometry::Ray &ray, const CesiumGltf::Model &gltf, bool cullBackFaces=true, const glm::dmat4x4 &gltfTransform=glm::dmat4(1.0))
Intersects a ray with a glTF model and returns the first intersection point.
static std::vector< std::string_view > parseGltfCopyright(const CesiumGltf::Model &gltf)
Parse the copyright field of a glTF model and return the individual credits.
static void setNodeTransform(CesiumGltf::Node &node, const glm::dmat4x4 &newTransform)
Sets the transformation matrix for a given node.
static void moveBufferContent(CesiumGltf::Model &gltf, CesiumGltf::Buffer &destination, CesiumGltf::Buffer &source)
Copies the content of one CesiumGltf::Buffer to the end of another, updates all CesiumGltf::BufferVie...
static void removeUnusedAccessors(CesiumGltf::Model &gltf, const std::vector< int32_t > &extraUsedAccessorIndices={})
Removes unused accessors from the given glTF model.
static void removeUnusedBuffers(CesiumGltf::Model &gltf, const std::vector< int32_t > &extraUsedBufferIndices={})
Removes unused buffers from the given glTF model.
static std::optional< glm::dmat4x4 > getNodeTransform(const CesiumGltf::Node &node)
Gets the transformation matrix for a given node.
static glm::dmat4x4 applyGltfUpAxisTransform(const CesiumGltf::Model &model, const glm::dmat4x4 &rootTransform)
Applies the glTF's gltfUpAxis, if any, to the given transform.
static CesiumGeospatial::BoundingRegion computeBoundingRegion(const CesiumGltf::Model &gltf, const glm::dmat4 &transform, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Computes a bounding region from the vertex positions in a glTF model.
static void removeUnusedMaterials(CesiumGltf::Model &gltf, const std::vector< int32_t > &extraUsedMaterialIndices={})
Removes unused materials from the given glTF model.
static void removeUnusedImages(CesiumGltf::Model &gltf, const std::vector< int32_t > &extraUsedImageIndices={})
Removes unused images from the given glTF model.
static void removeUnusedTextures(CesiumGltf::Model &gltf, const std::vector< int32_t > &extraUsedTextureIndices={})
Removes unused textures from the given glTF model.
static void collapseToSingleBuffer(CesiumGltf::Model &gltf)
Merges all of the glTF's buffers into a single buffer (the first one).
static void compactBuffer(CesiumGltf::Model &gltf, int32_t bufferIndex)
Shrink a buffer by removing any sections that are not referenced by any BufferView.
static void removeUnusedMeshes(CesiumGltf::Model &gltf, const std::vector< int32_t > &extraUsedMeshIndices={})
Removes unused meshes from the given glTF model.
This class is not meant to be instantiated directly. Use Buffer instead.
This class is not meant to be instantiated directly. Use Model instead.
A node in the node hierarchy. When the node contains skin, all mesh.primitives MUST contain JOINTS_0 ...