World.getDominantMaterialInSphere

Finds the dominant voxel material inside a sphere volume.

Kind: Function

Environments: Game

Game

world:getDominantMaterialInSphere( position, radius )

Open the full Game reference

Parameters:

Name Type Description
world World The world to look in.
position Vec3 The center position of the sphere.
radius number The radius of the sphere.

Returns:

Type Description
integer The dominant material index value. (returns nil if no voxel was found)
integer The highest single-voxel density of the dominant material.
Vec3 The weighted average world position of the dominant material (biased toward dense, nearby voxels).