5#include <CesiumGeospatial/BoundingRegion.h>
6#include <CesiumGeospatial/Ellipsoid.h>
7#include <CesiumGeospatial/GlobeRectangle.h>
43 static std::optional<glm::dmat4x4>
73 const glm::dmat4x4& rootTransform);
95 const glm::dmat4x4& rootTransform);
117 const glm::dmat4& transform,
130 static std::vector<std::string_view>
171 const std::vector<int32_t>& extraUsedTextureIndices = {});
183 const std::vector<int32_t>& extraUsedSamplerIndices = {});
195 const std::vector<int32_t>& extraUsedImageIndices = {});
207 const std::vector<int32_t>& extraUsedAccessorIndices = {});
219 const std::vector<int32_t>& extraUsedBufferViewIndices = {});
231 const std::vector<int32_t>& extraUsedBufferIndices = {});
243 const std::vector<int32_t>& extraUsedMeshIndices = {});
255 const std::vector<int32_t>& extraUsedMaterialIndices = {});
281 glm::dvec3 primitivePoint = {};
286 glm::dmat4x4 primitiveToWorld = {};
291 glm::dvec3 worldPoint = {};
296 double rayToWorldPointDistanceSq = -1.0;
306 int32_t primitiveId = -1;
316 std::optional<RayGltfHit>
hit;
321 std::vector<std::string> warnings{};
341 bool cullBackFaces =
true,
342 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 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 ...