4 #include "RasterOverlayDetails.h"
6 #include <CesiumGeometry/QuadtreeTileID.h>
7 #include <CesiumGeospatial/Ellipsoid.h>
8 #include <CesiumGeospatial/Projection.h>
10 #include <glm/fwd.hpp>
13 #include <string_view>
23 static constexpr std::string_view DEFAULT_TEXTURE_COORDINATE_BASE_NAME =
76 static std::optional<RasterOverlayDetails>
79 const glm::dmat4& modelToEcefTransform,
80 const std::optional<CesiumGeospatial::GlobeRectangle>& globeRectangle,
81 std::vector<CesiumGeospatial::Projection>&& projections,
82 bool invertVCoordinate =
false,
83 const std::string_view& textureCoordinateAttributeBaseName =
84 DEFAULT_TEXTURE_COORDINATE_BASE_NAME,
85 int32_t firstTextureCoordinateID = 0);
116 bool hasInvertedVCoordinate =
false,
117 const std::string_view& textureCoordinateAttributeBaseName =
118 DEFAULT_TEXTURE_COORDINATE_BASE_NAME,
119 int32_t textureCoordinateIndex = 0,
162 double geometricError,
163 double maximumScreenSpaceError,
A quadratic surface defined in Cartesian coordinates.
static const Ellipsoid WGS84
An Ellipsoid instance initialized to the WGS84 standard.
std::variant< GeographicProjection, WebMercatorProjection > Projection
A projection.
Classes for working with glTF models.
Classes for raster overlays, which allow draping massive 2D textures over a model.
A node of a tile hierarchy that was created by upsampling the tile content of a parent node.
The root object for a glTF asset.
static glm::dvec2 computeDesiredScreenPixels(double geometricError, double maximumScreenSpaceError, const CesiumGeospatial::Projection &projection, const CesiumGeometry::Rectangle &rectangle, const CesiumGeospatial::Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID)
Computes the desired screen pixels for a raster overlay texture.
static std::optional< RasterOverlayDetails > createRasterOverlayTextureCoordinates(CesiumGltf::Model &gltf, const glm::dmat4 &modelToEcefTransform, const std::optional< CesiumGeospatial::GlobeRectangle > &globeRectangle, std::vector< CesiumGeospatial::Projection > &&projections, bool invertVCoordinate=false, const std::string_view &textureCoordinateAttributeBaseName=DEFAULT_TEXTURE_COORDINATE_BASE_NAME, int32_t firstTextureCoordinateID=0)
Creates texture coordinates for mapping RasterOverlay tiles to a glTF model.
static glm::dvec4 computeTranslationAndScale(const CesiumGeometry::Rectangle &geometryRectangle, const CesiumGeometry::Rectangle &overlayRectangle)
Computes the texture translation and scale necessary to align a raster overlay with the given rectang...
static std::optional< CesiumGltf::Model > upsampleGltfForRasterOverlays(const CesiumGltf::Model &parentModel, CesiumGeometry::UpsampledQuadtreeNode childID, bool hasInvertedVCoordinate=false, const std::string_view &textureCoordinateAttributeBaseName=DEFAULT_TEXTURE_COORDINATE_BASE_NAME, int32_t textureCoordinateIndex=0, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Creates a new glTF model from one of the quadtree children of the given parent model.