Companion

object Companion

Properties

Link copied to clipboard
lateinit var camera: Camera
Link copied to clipboard
const val cameraToCenterDistance: Float = 0.0f
Link copied to clipboard

CustomLayerRenderParameters.zoom for the frame currently being rendered in com.mapbox.maps.CustomLayerHost.render. Cleared after render.

Link copied to clipboard
const val DEG2RAD: Double
Link copied to clipboard
Link copied to clipboard
const val EARTH_CIRCUMFERENCE_EQUATOR: Int = 40075017
Link copied to clipboard
const val EARTH_RADIUS: Double = 6371008.8
Link copied to clipboard
const val FOV_ORTHO: Double
Link copied to clipboard

Last CustomLayerRenderParameters.zoom from CustomLayerMatrixBridge.pushToCameraSync. Not cleared with customLayerRenderZoom so async CPU work (instanced wind gather) uses the same Mercator scale as the custom-layer projection matrices instead of MapboxMap.cameraState.zoom, which can diverge during pinch-zoom and causes rapid sub-pixel jitter.

Link copied to clipboard

Filled by CustomLayerMatrixBridge each com.mapbox.maps.CustomLayerHost.render frame. Encoded raster com.xweather.mapsgl.gl.RenderPass uses these (paired) so tiles share the same clip-space transform as the Mapbox basemap under pitch/bearing; do not mix with camera projection/view for that path.

Link copied to clipboard
Link copied to clipboard
const val MERCATOR_A: Double
Link copied to clipboard
Link copied to clipboard
const val RAD2DEG: Double
Link copied to clipboard
var rotScalePitchMatrix: Matrix4
Link copied to clipboard
var scaleMatrix: Matrix4
Link copied to clipboard
var translationMatrix: Matrix4
Link copied to clipboard
const val WORLD_SIZE: Int = 1024000
Link copied to clipboard
var worldMatrix: ProjectionMatrix

Functions

Link copied to clipboard
fun calculateCameraMatrixDeg(pitch: Float, bearing: Float, translateZ: Matrix4): Matrix4

Scale (tile zoom) then bearing (Z) then pitch (X), using post-multiplication so each rotation applies in map/tangent space: M = T_scale × R_z(-bearing) × R_x(pitch). The previous left-multiplication chain (R_x × R_z × T) put the map plane in the wrong orientation relative to the perspective camera except at specific bearing/pitch combos.

Link copied to clipboard

CPU instance Mercator XY uses world pixels at zBuild (512×2^zBuild). Custom-layer P/MV are for zoomForCustomLayerInstancing. Apply this factor to stored positions in the vertex shader so they match the current matrices between async instance rebuilds (removes zoom jitter).

Link copied to clipboard
fun tileRasterOverscale(mapZoom: Double, tileZ: Int): Float

Extra scale for 512×512 raster tile quads in Mapbox custom-layer space relative to integer tile Z. Uses fractional mapZoom so encoded rasters track zoom between integers instead of stepping when mapZoom crosses whole numbers.

Link copied to clipboard

Zoom aligned with Mapbox custom-layer CustomLayerRenderParameters for this frame / last render.