World.sphereVoxelDensitySubtraction

Modify destructable terrain with a sphere shape

Kind: Function

Environments: Game

Game

world:sphereVoxelDensitySubtraction(
    position,
    radius,
    filter,
    strength,
    callback,
    params
)

Open the full Game reference

Availability: Server only

Parameters:

Name Type Description
world World The world.
position Vec3 The world position of the sphere.
radius number The radius of the sphere.
filter (optional) integer The materials the shape can modify. (See sm.world.voxelFilter). (Defaults to sm.world.voxelFilter.all)
strength (optional) number The strength of the modification. (Defaults to radius)
callback (optional) string Lua function to call when cell is loaded. Callback parameters are a table of destruction data { remDensities = {integer, ..}, avgPositions = {Vec3, ..} } and (optional) pass-through params passed to this function.
params (optional) any Parameter passed to the callback. (Optional)