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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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_changedmesh_vertex_spacingvertex_spacingrender_mouse_layermouse_layerrender_cull_margincull_marginrender_cast_shadowscast_shadowsshow_debug_collisioncollision_mode- an enum supporting FULL_GAME (previous off) and FULL_EDITOR (previous on)debug_level=DEBUG_CONTEXTREMEis the new name for all messages.set/get_mesh_vertex_spacingset/get_vertex_spacingTerrain3DStorage -> Terrain3DData
Terrain3DStorage is now Terrain3DData. References to
terrain.storage,terrain.get_storage()should be replaced withterrain.dataorterrain.get_data(). Terrain3DStorage still exists as a deprecated class only for upgrading. Don't use it.Terrain3DStorage: ResourceTerrain3DData: ObjectTerrain3DStorage.MapTypeTerrain3DRegion.MapTypeTerrain3DStorage.RegionSizeTerrain3D.RegionSizeregion_offsetsregion_locationssave_16_bitTerrain3D.save_16_bitadd_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_offsetsset/get_region_locationsget_region_offsetget_region_locationget_region_offset_from_indexget_region_indexget_region_idget_region_index_from_offsetget_region_id(position)get_region_idp(position),get_region_id(location)has_region(position)has_regionp(position),has_region(location)get_height_ridget_height_maps_ridget_control_ridget_control_maps_ridget_color_ridget_color_maps_ridset/get_height_mapsset/get_control_mapsset/get_color_mapsset/get_map_regionset_mapsset/get_region_sizeTerrain3D.set/get_region_sizeset/get_save_16_bitTerrain3D.set/get_save_16_bitregions_changedmaps_changed- When any map/region regeneratedregion_map_changed- When region map regenerated (new)height_maps_changedheight_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_offsetclear_by_locationclear_by_region_idget_mmisget_multimesh/pget_multimesh_instance/pset_cast_shadows*Beta Was this translation helpful? Give feedback.
All reactions