godot_voxel/doc/classes/VoxelTerrain.xml

159 lines
7.4 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<class name="VoxelTerrain" inherits="VoxelNode" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Voxel volume using constant level of detail.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="_on_area_edited" qualifiers="virtual">
<return type="void" />
<param index="0" name="area_origin" type="Vector3i" />
<param index="1" name="area_size" type="Vector3i" />
<description>
</description>
</method>
<method name="_on_data_block_entered" qualifiers="virtual">
<return type="void" />
<param index="0" name="info" type="VoxelDataBlockEnterInfo" />
<description>
</description>
</method>
<method name="data_block_to_voxel" qualifiers="const">
<return type="Vector3i" />
<param index="0" name="block_pos" type="Vector3i" />
<description>
Converts data block coordinates into voxel coordinates. Voxel coordinates of a block correspond to its lowest corner.
</description>
</method>
<method name="get_data_block_size" qualifiers="const">
<return type="int" />
<description>
</description>
</method>
<method name="get_statistics" qualifiers="const">
<return type="Dictionary" />
<description>
Gets debug information about how much time is spent processing the terrain.
The returned dictionary has the following structure:
[codeblock]
{
"time_detect_required_blocks": int,
"time_request_blocks_to_load": int,
"time_process_load_responses": int,
"time_request_blocks_to_update": int,
"time_process_update_responses": int,
"remaining_main_thread_blocks": int,
"dropped_block_loads": int,
"dropped_block_meshs": int,
"updated_blocks": int
}
[/codeblock]
</description>
</method>
<method name="get_viewer_network_peer_ids_in_area" qualifiers="const">
<return type="PackedInt32Array" />
<param index="0" name="area_origin" type="Vector3i" />
<param index="1" name="area_size" type="Vector3i" />
<description>
</description>
</method>
<method name="get_voxel_tool">
<return type="VoxelTool" />
<description>
Creates an instance of [VoxelTool] bound to this node, to access voxels and edition methods.
You can keep it in a member variable to avoid creating one again, as long as the node still exists.
</description>
</method>
<method name="has_data_block" qualifiers="const">
<return type="bool" />
<param index="0" name="block_position" type="Vector3i" />
<description>
</description>
</method>
<method name="save_block">
<return type="void" />
<param index="0" name="position" type="Vector3i" />
<description>
Forces a specific block to be saved.
Note 1: all modified blocks are automatically saved before the terrain is destroyed.
Note 2: this will only have an effect if the stream setup on this terrain supports saving.
Note 3: saving is asynchronous and won't block the game. the save may complete only a short time after you call this method.
</description>
</method>
<method name="save_modified_blocks">
<return type="void" />
<description>
Forces all modified blocks to be saved.
Note 1: all modified blocks are automatically saved before the terrain is destroyed.
Note 2: this will only have an effect if the stream setup on this terrain supports saving.
Note 3: saving is asynchronous and won't block the game. the save may complete only a short time after you call this method.
</description>
</method>
<method name="try_set_block_data">
<return type="bool" />
<param index="0" name="position" type="Vector3i" />
<param index="1" name="voxels" type="VoxelBuffer" />
<description>
</description>
</method>
<method name="voxel_to_data_block" qualifiers="const">
<return type="Vector3i" />
<param index="0" name="voxel_pos" type="Vector3" />
<description>
</description>
</method>
</methods>
<members>
<member name="area_edit_notification_enabled" type="bool" setter="set_area_edit_notification_enabled" getter="is_area_edit_notification_enabled" default="false">
</member>
<member name="automatic_loading_enabled" type="bool" setter="set_automatic_loading_enabled" getter="is_automatic_loading_enabled" default="true">
</member>
<member name="block_enter_notification_enabled" type="bool" setter="set_block_enter_notification_enabled" getter="is_block_enter_notification_enabled" default="false">
</member>
<member name="bounds" type="AABB" setter="set_bounds" getter="get_bounds" default="AABB(-5.36871e+08, -5.36871e+08, -5.36871e+08, 1.07374e+09, 1.07374e+09, 1.07374e+09)">
Defines the bounds within which the terrain is allowed to have voxels. If an infinite world generator is used, blocks will only generate within this region. Everything outside will be left empty.
</member>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
</member>
<member name="collision_margin" type="float" setter="set_collision_margin" getter="get_collision_margin" default="0.04">
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
</member>
<member name="generate_collisions" type="bool" setter="set_generate_collisions" getter="get_generate_collisions" default="true">
Enables the generation of collision shapes using the classic physics engine. Use this feature if you need realistic or non-trivial collisions or physics.
Note 1: you also need [VoxelViewer] to request collisions, otherwise they won't generate.
Note 2: If you need simple Minecraft/AABB physics, you can use [VoxelBoxMover] which may perform better in blocky worlds.
</member>
<member name="material_override" type="Material" setter="set_material_override" getter="get_material_override">
</member>
<member name="max_view_distance" type="int" setter="set_max_view_distance" getter="get_max_view_distance" default="128">
Sets the maximum distance this terrain can support. If a [VoxelViewer] requests more, it will be clamped.
Note: there is an internal limit of 512 for constant LOD terrains, because going further can affect performance and memory very badly at the moment.
</member>
<member name="mesh_block_size" type="int" setter="set_mesh_block_size" getter="get_mesh_block_size" default="16">
</member>
<member name="run_stream_in_editor" type="bool" setter="set_run_stream_in_editor" getter="is_stream_running_in_editor" default="true">
Makes the terrain appear in the editor.
Important: this option will turn off automatically if you setup a script world generator. Modifying scripts while they are in use by threads causes undefined behaviors. You can still turn on this option if you need a preview, but it is strongly advised to turn it back off and wait until all generation has finished before you edit the script again.
</member>
</members>
<signals>
<signal name="block_loaded">
<param index="0" name="position" type="Vector3" />
<description>
Emitted when a new data block is loaded from stream.
Note: it might be not visible yet.
</description>
</signal>
<signal name="block_unloaded">
<param index="0" name="position" type="Vector3" />
<description>
Emitted when a data block is unloaded due to being outside view distance.
</description>
</signal>
</signals>
</class>