Class RenderContext


  • public class RenderContext
    extends java.lang.Object
    • Field Detail

      • globe

        public Globe globe
      • terrainTessellator

        public Tessellator terrainTessellator
      • currentLayer

        public Layer currentLayer
      • verticalExaggeration

        public double verticalExaggeration
      • horizonDistance

        public double horizonDistance
      • camera

        public Camera camera
      • cameraPoint

        public Vec3 cameraPoint
      • viewport

        public final Viewport viewport
      • projection

        public final Matrix4 projection
      • modelview

        public final Matrix4 modelview
      • modelviewProjection

        public final Matrix4 modelviewProjection
      • frustum

        public final Frustum frustum
      • resources

        public android.content.res.Resources resources
      • pickViewport

        public Viewport pickViewport
      • pickPoint

        public Vec2 pickPoint
      • pickRay

        public Line pickRay
      • pickMode

        public boolean pickMode
    • Constructor Detail

      • RenderContext

        public RenderContext()
    • Method Detail

      • reset

        public void reset()
      • isRedrawRequested

        public boolean isRedrawRequested()
      • requestRedraw

        public void requestRedraw()
      • pixelSizeAtDistance

        public double pixelSizeAtDistance​(double distance)
        Returns the height of a pixel at a given distance from the eye point. This method assumes the model of a screen composed of rectangular pixels, where pixel coordinates denote infinitely thin space between pixels. The units of the returned size are in meters per pixel.
        The result of this method is undefined if the distance is negative.
        Parameters:
        distance - the distance from the eye point in meters
        Returns:
        the pixel height in meters per pixel
      • project

        public boolean project​(Vec3 modelPoint,
                               Vec3 result)
        Projects a Cartesian point to screen coordinates. The resultant screen point is in OpenGL screen coordinates, with the origin in the bottom-left corner and axes that extend up and to the right from the origin.
        This stores the projected point in the result argument, and returns a boolean value indicating whether or not the projection is successful. This returns false if the Cartesian point is clipped by the near clipping plane or the far clipping plane.
        Parameters:
        modelPoint - the Cartesian point to project
        result - a pre-allocated Vec3 in which to return the projected point
        Returns:
        true if the transformation is successful, otherwise false
        Throws:
        java.lang.IllegalArgumentException - If any argument is null
      • projectWithDepth

        public boolean projectWithDepth​(Vec3 modelPoint,
                                        double depthOffset,
                                        Vec3 result)
        Projects a Cartesian point to screen coordinates, applying an offset to the point's projected depth value. The resultant screen point is in OpenGL screen coordinates, with the origin in the bottom-left corner and axes that extend up and to the right from the origin.
        This stores the projected point in the result argument, and returns a boolean value indicating whether or not the projection is successful. This returns false if the Cartesian point is clipped by the near clipping plane or the far clipping plane.
        The depth offset may be any real number and is typically used to move the screenPoint slightly closer to the user's eye in order to give it visual priority over nearby objects or terrain. An offset of zero has no effect. An offset less than zero brings the screenPoint closer to the eye, while an offset greater than zero pushes the projected screen point away from the eye.
        Applying a non-zero depth offset has no effect on whether the model point is clipped by this method or by WebGL. Clipping is performed on the original model point, ignoring the depth offset. The final depth value after applying the offset is clamped to the range [0,1].
        Parameters:
        modelPoint - the Cartesian point to project
        depthOffset - the amount of depth offset to apply
        result - a pre-allocated Vec3 in which to return the projected point
        Returns:
        true if the transformation is successful, otherwise false
        Throws:
        java.lang.IllegalArgumentException - If any argument is null
      • geographicToCartesian

        public Vec3 geographicToCartesian​(double latitude,
                                          double longitude,
                                          double altitude,
                                          int altitudeMode,
                                          Vec3 result)
        Converts a geographic position to Cartesian coordinates according to an WorldWind.AltitudeMode. The Cartesian coordinate system is a function of this render context's current globe and its the terrain surface, depending on the altitude mode. In general, it is not safe to cache the Cartesian coordinates, as many factors contribute to the value returned, and may change from one frame to the next.
        Parameters:
        latitude - the position's latitude in degrees
        longitude - the position's longitude in degrees
        altitude - the position's altitude in meters
        altitudeMode - an altitude mode indicating how to interpret the position's altitude component
        result - a pre-allocated Vec3 in which to store the computed X, Y and Z Cartesian coordinates
        Returns:
        the result argument, set to the computed Cartesian coordinates
        Throws:
        java.lang.IllegalArgumentException - if the result is null
      • getShaderProgram

        public ShaderProgram getShaderProgram​(java.lang.Object key)
      • getBufferObject

        public BufferObject getBufferObject​(java.lang.Object key)
      • offerDrawable

        public void offerDrawable​(Drawable drawable,
                                  int groupId,
                                  double order)
      • offerSurfaceDrawable

        public void offerSurfaceDrawable​(Drawable drawable,
                                         double zOrder)
      • offerShapeDrawable

        public void offerShapeDrawable​(Drawable drawable,
                                       double cameraDistance)
      • offerDrawableTerrain

        public void offerDrawableTerrain​(DrawableTerrain drawable,
                                         double cameraDistance)
      • sortDrawables

        public void sortDrawables()
      • drawableCount

        public int drawableCount()
      • getDrawablePool

        public <T extends DrawablePool<T> getDrawablePool​(java.lang.Class<T> key)
      • offerPickedObject

        public void offerPickedObject​(PickedObject pickedObject)
      • nextPickedObjectId

        public int nextPickedObjectId()
      • getUserProperty

        public java.lang.Object getUserProperty​(java.lang.Object key)
      • putUserProperty

        public java.lang.Object putUserProperty​(java.lang.Object key,
                                                java.lang.Object value)
      • removeUserProperty

        public java.lang.Object removeUserProperty​(java.lang.Object key)
      • hasUserProperty

        public boolean hasUserProperty​(java.lang.Object key)