Skip to content

ChronicleTerrainProvider ​

Inherits: TerrainProvider < Node

Answers the TerrainService from a ChronicleTerrain: heights, directions and holes come straight from the data of the terrain (no physics, no rendering: the same answer on a server as in front of a screen). Where the terrain has no tile the answer is the physics one (other ground on the ground layer: an island, a bridge), and for a ray or a search that can hit more than one ground the nearest of the terrain and the physics wins. ChronicleTerrain makes one of these itself: you do not add it to a scene.

Methods ​

boolsupports( _feature: StringName )
floatget_height( world: World3D, x: float, z: float )
Vector3get_normal( world: World3D, x: float, z: float )
Dictionaryget_ground( world: World3D, position: Vector3, up: float, down: float, exclude: Array = [], mask: int = -1 )
Dictionaryraycast_ground( world: World3D, from: Vector3, to: Vector3, exclude: Array = [] )
boolis_hole( _world: World3D, x: float, z: float )
boolis_ground_solid( _world: World3D, x: float, z: float )
boolis_navigable( world: World3D, x: float, z: float )
Stringget_surface_type( position: Vector3 )
Dictionaryget_texture_weights( position: Vector3 )

Method descriptions ​

bool supports( _feature: StringName ) ​

Does this provider answer the thing from the data of its terrain? The base class knows nothing but the physics of the world, so it supports nothing. A plugin provider lists what it can. (from TerrainProvider)

float get_height( world: World3D, x: float, z: float ) ​

The height of the terrain at x, z (NAN in a hole); where the terrain has no tile, the physics answer.

Vector3 get_normal( world: World3D, x: float, z: float ) ​

The direction of the ground of the terrain at x, z.

Dictionary get_ground( world: World3D, position: Vector3, up: float, down: float, exclude: Array = [], mask: int = -1 ) ​

The first ground near a position: the terrain, and anything else on the ground layers (a bridge); the higher one of the two, since the search goes down from above. A mask of layers that does not include the layers of the terrain is answered by the physics alone.

Dictionary raycast_ground( world: World3D, from: Vector3, to: Vector3, exclude: Array = [] ) ​

A ray that only the ground can stop: the terrain and the other ground, whichever is nearest.

bool is_hole( _world: World3D, x: float, z: float ) ​

Is there a hole in the terrain at x, z.

bool is_ground_solid( _world: World3D, x: float, z: float ) ​

Is there solid ground at x, z: false where the terrain has ground it has not made solid (too far from every player).

bool is_navigable( world: World3D, x: float, z: float ) ​

Can something walk at x, z: the ground of the terrain and navigation mesh on it.

String get_surface_type( position: Vector3 ) ​

The surface type of the terrain texture with the most weight at a position (the default surface where the terrain is not painted).

Dictionary get_texture_weights( position: Vector3 ) ​

The textures under a position and their shares: {terrain texture id: share}.