VoxelToolLodTerrain

Inherits: VoxelTool

Implementation of VoxelTool specialized for uses on VoxelLodTerrain.

Description:

Functions in this class are specific to VoxelLodTerrain. For generic functions, you may also check VoxelTool.

It's not a class to instantiate alone, you may get it from VoxelLodTerrain using the get_voxel_tool() method.

Methods:

Return Signature
void do_graph ( VoxelGeneratorGraph graph, Transform3D transform, Vector3 area_size )
void do_hemisphere ( Vector3 center, float radius, Vector3 flat_direction, float smoothness=0.0 )
void do_sphere_async ( Vector3 center, float radius )
int get_raycast_binary_search_iterations ( ) const
float get_voxel_f_interpolated ( Vector3 position ) const
Array separate_floating_chunks ( AABB box, Node parent_node )
void set_raycast_binary_search_iterations ( int iterations )
void stamp_sdf ( VoxelMeshSDF mesh_sdf, Transform3D transform, float isolevel, float sdf_scale )

Method Descriptions

void do_graph( VoxelGeneratorGraph graph, Transform3D transform, Vector3 area_size )

(This method has no documentation)

void do_hemisphere( Vector3 center, float radius, Vector3 flat_direction, float smoothness=0.0 )

(This method has no documentation)

void do_sphere_async( Vector3 center, float radius )

(This method has no documentation)

int get_raycast_binary_search_iterations( )

(This method has no documentation)

float get_voxel_f_interpolated( Vector3 position )

(This method has no documentation)

Array separate_floating_chunks( AABB box, Node parent_node )

Turns floating voxels into RigidBodies.

Chunks of floating voxels are detected within a box. The box is relative to the voxel volume this VoxelTool is attached to. Chunks have to be contained entirely within that box to be considered floating. Chunks are removed from the source volume and transformed into RigidBodies with convex collision shapes. They will be added as child of the provided node. They will start "kinematic", and turn "rigid" after a short time, to allow the terrain to update its colliders after the removal (otherwise they will overlap). The function returns an array of these rigid bodies, which you can use to attach further behavior to them (such as disappearing after some time or distance for example).

This algorithm can become expensive quickly, so the box should not be too big. A size of around 30 voxels should be ok.

void set_raycast_binary_search_iterations( int iterations )

(This method has no documentation)

void stamp_sdf( VoxelMeshSDF mesh_sdf, Transform3D transform, float isolevel, float sdf_scale )

(This method has no documentation)

Generated on Apr 06, 2024