Geodot Plugin
|
Public Types | |
enum | INTERPOLATION { NEAREST , BILINEAR , CUBIC , CUBICSPLINE , LANCZOS , AVG , MODE , MAX , MIN , MED , Q1 , Q2 } |
Public Member Functions | |
bool | is_valid () |
void | set_raster (GeoRaster *raster, INTERPOLATION interpolation) |
void | set_raster_from_band (GeoRaster *raster, INTERPOLATION interpolation, int band_index) |
Like set_raster but uses only the band at band_index from raster. | |
Ref< Image > | get_image () |
Get a Godot Image with the GeoImage's data. | |
Ref< ImageTexture > | get_image_texture () |
Get a Godot ImageTexture with the GeoImage's data. | |
Ref< Image > | get_normalmap_for_heightmap (float scale) |
Ref< HeightMapShape3D > | get_shape_for_heightmap () |
Ref< ImageTexture > | get_normalmap_texture_for_heightmap (float scale) |
Array | get_most_common (int number_of_entries) |
Static Protected Member Functions | |
static void | _bind_methods () |
Array GeoImage::get_most_common | ( | int | number_of_entries | ) |
Get the number_of_entries most common values in the raster. Only functional for single-band BYTE data!
Ref< Image > GeoImage::get_normalmap_for_heightmap | ( | float | scale | ) |
Assuming the image is a heightmap, return the normal map corresponding to that heightmap. Somewhat costly because the generated heightmap has a higher precision than Godot's Image::bumpmap_to_normalmap.
Ref< ImageTexture > GeoImage::get_normalmap_texture_for_heightmap | ( | float | scale | ) |
Wrapper for get_normalmap_for_heightmap which directly provides an ImageTexture with the image.
Ref< HeightMapShape3D > GeoImage::get_shape_for_heightmap | ( | ) |
Returns a HeightMapShape3D which can be used for colliding with terrain created from a heightmap image. In order to perfectly match the terrain, the rows and columns of vertices in the terrain mesh must match the GeoImage width and height exactly, and the terrain mesh must be constructed out of regular quads since the HeightMapShape3D is implemented this way internally. Only returns something useful when the GeoImage is of type Float.
void GeoImage::set_raster | ( | GeoRaster * | raster, |
INTERPOLATION | interpolation | ||
) |
Import a GeoRaster and prepare the Godot Image Should not be called from the outside; Geodot only returns GeoImages which already have raster data.