Class BasicTerrain

  • All Implemented Interfaces:
    Terrain

    public class BasicTerrain
    extends java.lang.Object
    implements Terrain
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicTerrain()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTile​(TerrainTile tile)  
      void clear()  
      Sector getSector()
      Indicates the geographic rectangular region that contains this terrain.
      boolean intersect​(Line line, Vec3 result)
      Computes the first intersection of this terrain with a specified line in Cartesian coordinates.
      void setTriStripElements​(short[] elements)  
      boolean surfacePoint​(double latitude, double longitude, Vec3 result)
      Computes the Cartesian coordinates of a geographic location on the terrain surface.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasicTerrain

        public BasicTerrain()
    • Method Detail

      • clear

        public void clear()
      • setTriStripElements

        public void setTriStripElements​(short[] elements)
      • getSector

        public Sector getSector()
        Description copied from interface: Terrain
        Indicates the geographic rectangular region that contains this terrain. The returned sector may contain geographic areas where the terrain is nonexistent.
        Specified by:
        getSector in interface Terrain
        Returns:
        the terrain's bounding sector
      • intersect

        public boolean intersect​(Line line,
                                 Vec3 result)
        Description copied from interface: Terrain
        Computes the first intersection of this terrain with a specified line in Cartesian coordinates. The line is interpreted as a ray; intersection points behind the line's origin are ignored. If the line does not intersect the geometric surface modeled by this terrain, this returns false and does not modify the result argument.
        Specified by:
        intersect in interface Terrain
        Parameters:
        line - the line to intersect with this terrain
        result - a pre-allocated Vec3 in which to return the intersection point
        Returns:
        true if the ray intersects this terrain, otherwise false
      • surfacePoint

        public boolean surfacePoint​(double latitude,
                                    double longitude,
                                    Vec3 result)
        Description copied from interface: Terrain
        Computes the Cartesian coordinates of a geographic location on the terrain surface. If the latitude and longitude are outside the geometric surface modeled by this terrain, this returns false and does not modify the result argument.
        Specified by:
        surfacePoint in interface Terrain
        Parameters:
        latitude - the location's latitude in degrees
        longitude - the location's longitude in degrees
        result - a pre-allocated Vec3 in which to store the computed X, Y and Z Cartesian coordinates
        Returns:
        true if the geographic location is on the terrain surface, otherwise false