0.9.3 API Changes #485
TokisanGames
announced in
Architecture
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This release comes with a number of API changes noted below. This list predominantly includes new names for old functions. There are many new API additions that are not listed, which you can find in the docs.
The new API moves away from region_id, an index into the texture arrays sent to the shader. This value can change at any time and generally shouldn't be used by gamedevs. Instead, the focus is more on indexing content by region_location; the region coordinates that represent physical space in the world. Region coordinates are calculated by
floor(global_position/region_size)
, or by callingTerrain3D.get_region_location(position)
. So at a region size of 1024, the position (2500, 0, 3700) translates into region location (2, 3).Terrain3D
storage_changed
mesh_vertex_spacing
vertex_spacing
render_mouse_layer
mouse_layer
render_cull_margin
cull_margin
render_cast_shadows
cast_shadows
show_debug_collision
collision_mode
- an enum supporting FULL_GAME (previous off) and FULL_EDITOR (previous on)debug_level=DEBUG_CONT
EXTREME
is the new name for all messages.set/get_mesh_vertex_spacing
set/get_vertex_spacing
Terrain3DStorage -> Terrain3DData
Terrain3DStorage is now Terrain3DData. References to
terrain.storage
,terrain.get_storage()
should be replaced withterrain.data
orterrain.get_data()
. Terrain3DStorage still exists as a deprecated class only for upgrading. Don't use it.Terrain3DStorage
: ResourceTerrain3DData
: ObjectTerrain3DStorage.MapType
Terrain3DRegion.MapType
Terrain3DStorage.RegionSize
Terrain3D.RegionSize
region_offsets
region_locations
save_16_bit
Terrain3D.save_16_bit
add_region(images)
add_region(region)
Add_region now takes a Terrain3DRegion. There are additional add_region* helper functions that offer additional options in the API.set/get_region_offsets
set/get_region_locations
get_region_offset
get_region_location
get_region_offset_from_index
get_region_index
get_region_id
get_region_index_from_offset
get_region_id(position)
get_region_idp(position)
,get_region_id(location)
has_region(position)
has_regionp(position)
,has_region(location)
get_height_rid
get_height_maps_rid
get_control_rid
get_control_maps_rid
get_color_rid
get_color_maps_rid
set/get_height_maps
set/get_control_maps
set/get_color_maps
set/get_map_region
set_maps
set/get_region_size
Terrain3D.set/get_region_size
set/get_save_16_bit
Terrain3D.set/get_save_16_bit
regions_changed
maps_changed
- When any map/region regeneratedregion_map_changed
- When region map regenerated (new)height_maps_changed
height_maps_changed
- when height maps are regenerated (no change)control_maps_changed
- when control maps are regenerated (new)color_maps_changed
- when color maps are regenerated (new)maps_edited(AABB)
maps_edited(AABB)
- when a heightmap is modified with the AABB (no change)Terrain3DInstancer
clear_by_offset
clear_by_location
clear_by_region_id
get_mmis
get_multimesh/p
get_multimesh_instance/p
set_cast_shadows
*
Beta Was this translation helpful? Give feedback.
All reactions