From 617de029fadea3d0c9e0ba1c6b522703c85fe36f Mon Sep 17 00:00:00 2001 From: AtlasProgramming Date: Fri, 4 Jul 2025 15:52:12 -0400 Subject: [PATCH] Added the nearClippedProjMatrix to the drawing context (#3599) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: “Malcolm <“mtoon@atlasprogramming.com”> Co-authored-by: Bart Louwers --- platform/darwin/src/MLNPluginLayer.h | 3 +++ platform/ios/src/MLNMapView.mm | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/darwin/src/MLNPluginLayer.h b/platform/darwin/src/MLNPluginLayer.h index b188e4fb2..2e977b8d0 100644 --- a/platform/darwin/src/MLNPluginLayer.h +++ b/platform/darwin/src/MLNPluginLayer.h @@ -80,6 +80,9 @@ typedef struct MLNPluginLayerDrawingContext { CGFloat fieldOfView; /// A 4×4 matrix representing the map view’s current projection state. MLNMatrix4 projectionMatrix; + /// A 4×4 matrix representing the map view’s current near clip projection state. + MLNMatrix4 nearClippedProjMatrix; + } MLNPluginLayerDrawingContext; MLN_EXPORT diff --git a/platform/ios/src/MLNMapView.mm b/platform/ios/src/MLNMapView.mm index 1337f0c6b..483486974 100644 --- a/platform/ios/src/MLNMapView.mm +++ b/platform/ios/src/MLNMapView.mm @@ -7748,11 +7748,8 @@ static void *windowScreenContext = &windowScreenContext; drawingContext.direction = mbgl::util::rad2deg(-state.getBearing()); drawingContext.pitch = state.getPitch(); drawingContext.fieldOfView = state.getFieldOfView(); - mbgl::mat4 projMatrix; - state.getProjMatrix(projMatrix); - drawingContext.projectionMatrix = MLNMatrix4Make(projMatrix); - - //NSLog(@"Rendering"); + drawingContext.projectionMatrix = MLNMatrix4Make(paintParameters.transformParams.projMatrix); + drawingContext.nearClippedProjMatrix = MLNMatrix4Make(paintParameters.transformParams.nearClippedProjMatrix); // Call update with the scene state variables [weakPlugInLayer onUpdateLayer:drawingContext];