#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) { // from RenderTile::prepare mat4 tileMatrix; state.matrixFor(/*out*/ tileMatrix, tileID); // nearClippedMatrix has near plane moved further, to enhance depth buffer precision const auto& params = renderTree.getParameters().transformParams; const auto& projMatrix = nearClipped ? params.nearClippedProjMatrix : params.projMatrix; matrix::multiply(tileMatrix, projMatrix, tileMatrix); return RenderTile::translateVtxMatrix(tileID, tileMatrix, translation, anchor, state, inViewportPixelUnits); } } // namespace mbgl