#include #include #include #include #include #include namespace mbgl { LayerTweaker::LayerTweaker(Immutable properties) : evaluatedProperties(std::move(properties)) {} mat4 LayerTweaker::getTileMatrix(const UnwrappedTileID& tileID, const RenderTree& renderTree, const TransformState& state, const std::array& translation, style::TranslateAnchorType anchor, bool nearClipped, bool inViewportPixelUnits, bool aligned) { // from RenderTile::prepare mat4 tileMatrix; state.matrixFor(/*out*/ tileMatrix, tileID); const auto& transformParams = renderTree.getParameters().transformParams; // nearClippedMatrix has near plane moved further, to enhance depth buffer precision const auto& projMatrix = aligned ? transformParams.alignedProjMatrix : (nearClipped ? transformParams.nearClippedProjMatrix : transformParams.projMatrix); matrix::multiply(tileMatrix, projMatrix, tileMatrix); return RenderTile::translateVtxMatrix(tileID, tileMatrix, translation, anchor, state, inViewportPixelUnits); } } // namespace mbgl